JavaScript: Number.isNaN

By Xah Lee. Date: . Last updated: .
Number.isNaN( number )
If number is NaN, return true, else false. [see NaN]
console.log( Number.isNaN( NaN ) ); // true

console.log( Number.isNaN( "NaN" ) ); // false
console.log( Number.isNaN( "3" ) ); // false
console.log( Number.isNaN( 3 ) ); // false
console.log( Number.isNaN( Infinity ) ); // false

window.isNaN vs Number.isNaN

window.isNaN converts argument to number first. Number.isNaN does not.

[see isNaN]

JS in Depth
XAH  BUY NOW

JS in Depth

JS Obj Ref

DOM


JS Obj Ref

Number

prototype