NaN (JavaScript)

A value that is not a number.

Defined in

Number (Standard - JavaScript)

Syntax

Number.NaN

Usage

NaN is a constant and has the same value whether called statically as shown in the syntax or from an object.

Examples

This example prints NaN.
function p(stuff) {
 	print("<<<" + stuff + ">>>");
}

try {
	p(Number.NaN.toString()); // prints <<<?>>>
	n = new Number(Math.sqrt(-2));
	p(n); // prints <<<NaN>>>
	
} catch(e) {
	p("Error = " + e);
}