I was working on type conversion of Boolean values to Number in javascript.
console.log(new Number(true));//Prints 1 console.log(+true);//Prints 1 console.log(pa
Because parseInt expects a string and 'true' is NaN.
parseInt
'true'
NaN
From MDN:
parseInt() The parseInt() function parses a string argument and returns an integer of the specified radix (the base in mathematical numeral systems).
parseInt()
The parseInt() function parses a string argument and returns an integer of the specified radix (the base in mathematical numeral systems).