NaN

suggest change

NaN stands for “Not a Number.” It is the result of an operation that should produce a number but cannot, such as 0 / 0 or Math.sqrt(-1). Division by zero yields Infinity, not NaN.

It is a property of the global object, and a reference to Number.NaN.

globalThis.hasOwnProperty("NaN"); // true
NaN; // NaN

Perhaps confusingly, NaN is still considered a number.

typeof NaN; // 'number'

Don’t check for NaN using the equality operator. See Testing for NaN using isNaN instead.

NaN == NaN  // false
NaN === NaN // false

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents