Number class property
NaN is returned from functions where parsing to a number fails or from
Math functions where a numeric result can't be derived or is unobtainable.
Nanor not. For this reason we have the
isNan()global function which we can use to determine whether a value is
|Global property that represents the value Not-A-Number.|
Below are some examples showing comparisons of
NaN and an unobtainable result.
// NaN. var nanValues = new Array(4); nanValues = NaN == NaN; // NaN not equal nanValues = NaN === NaN; // NaN not strict nanValues = isNaN(NaN); // check against isNaN nanValues = Number.POSITIVE_INFINITY * 0; // unobtainable alert(nanValues);