isNaN() returns false if and only if the argument is number.
var a = new Number(1);
By doing so, a is an object now.
So why is isNaN(a) returning false?
isNaN() tests whether an input is NOT a number.
var a = new Number(1)
a is a number object. Therefore isNaN() returns false.
Here is a nice documentation containing isNaN() behaviors with different edge cases. Unfortunately some of them are not as intuitive as hoped, so it's worth reading.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With