JS: isNaN

By Xah Lee. Date: . Last updated: .

isNaN is the value of the property key "isNaN" of the Global Object.

globalThis["isNaN"] === isNaN

Syntax

isNaN(arg)
Converts arg to number first, and return true if it is NaN, else, false. [see NaN]
console.log(isNaN(NaN));
console.log(isNaN("NaN"));

console.log(isNaN("3") === false);
console.log(isNaN(3) === false);
console.log(isNaN(Infinity) === false);

// all true

JavaScript, Special Literals

BUY ΣJS JavaScript in Depth