JavaScript (ES2026) reference · Number Methods and Properties

JavaScript Number.isNaN() Method

Return true only if a value is the number NaN. Unlike the global isNaN(), it doesn't convert strings first.

JavaScript (ES2026) Since ES2015

Create a free account to save this page, take notes and track your progress. Sign in

Syntax

Number.isNaN(value)

Parameters

ParameterDescription
value The value to test.

Return value

true or false.

Examples

Only NaN is NaNTry it yourself
console.log(Number.isNaN(NaN), Number.isNaN(0 / 0), Number.isNaN("hello"));

Output

true true false
Global isNaN() converts first; NaN never equals itselfTry it yourself
console.log(isNaN("hello"), Number.isNaN("hello"));
console.log(NaN === NaN);

Output

true false
false

Version history

VersionChange
JavaScript ES2015Added

Was this page helpful?