JS: isNaN
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 isNaN
, 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