isNaN Function

Top  Previous  Next

Determines if a value is NaN (not a number).

Syntax

isNaN(value)

Arguments

valueThe value to be checked for NaN. value is converted to Number first if necessary; note that this conversion can result in NaN.

Return Value

true if value is NaN; otherwise false.

Remarks

isNaN is necessary because comparing NaN with any value, including itself, always returns false. Thus the equality operators cannot be used to test for NaN.

See Also

isNaN