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]

BUY
ΣJS
JavaScript in Depth

JS Obj Reference

Number

prototype