parseFloattries to parse a number from a string where it isNaN converts an argument to a number before checking it:
Number("") //0 http://ecma-international.org/ecma-262/5.1/
parseFloat("") //NaN http://ecma-international.org/ecma-262/5.1/
This seems to be “broken” or “confusing,” so from the specs:
ECMAScript, , X NaN, X! == X. , X NaN.
0 !== 0
NaN !== NaN
function isExactlyNaN(x) {
return x !== x;
}