🔢NaN
not a number.
JS ⟩ scope ⟩ global ⟩ global object ⟩ property ⟩ NaN
( non-configurable, non-writable global object property )❗
a property of the global object. (that is, a variable in global scope).
equivalent to Number.NaN.
NaN
is the only value that doesn't equal to itself❗
// ⭐️ `NaN` is the ONLY ONE that doesn't equal to itself.
NaN === NaN, // false❗️
NaN !== NaN, // true❗️
// equivalent forms
Number.isNaN(x) === (x !== x)
trichotomy law: a < b, a = b, a > b
doesn't apply to NaN❗
3 < NaN, // false❗
3 == NaN, // false❗
3 > NaN, // false❗
Last updated
Was this helpful?