The primitive value NaN represents the IEEE 754 "Not-a-Number" value. This is returned when the result of an evaluation is known to yield a numeric value but its magnitude and sign is uncertain. Because the value is numeric but uncertain, you cannot compare NaN with anything else (including itself). However you can test for its existence with the isNaN() function.
It is possible in the hosting environment to provide additional facilities to determine what sort of NaN values you have. This is implementation-dependent however and not part of the standard.
If you are in an environment that does not have the NaN value implemented, then you may be able to create one yourself like this:
var NaN = 0/0;
Be careful not to assign your own values to this variable. You can corrupt it in some implementations. In MSIE version 5 for Macintosh, assigning a value to the global NaN value changes its setting but leaves Number.NaN unaffected. You cannot modify Number.NaN.
Version 3.02 of MSIE with JScript version 1.0 silently converts NaN values to zero. It does not know what NaN is.
Netscape 2.02 cannot tell the difference between null and undefined.
This constant is available as a property of the Global object in MSIE version 4 but not in Netscape 4.
ECMA 262 edition 2 - section - 4.3.23
ECMA 262 edition 2 - section - 22.214.171.124
ECMA 262 edition 3 - section - 4.3.23
ECMA 262 edition 3 - section - 126.96.36.199