Is NaN Method
The Is NaN method determines if the value that the value argument contains is a number. It returns one of the following values:
The value is a number. It returns the following value:
True
The value is not a number. It returns the following value:
False
If the value argument references an object, then the Is NaN method always returns true because an object reference is not a number. For more information on the number object, see NaN Numbers.
Format
isNaN(value)
The following table describes the arguments for the Is NaN method.
Argument | Description |
---|---|
value |
The variable or expression that this method evaluates. |
Example
The following examples use the Is NaN method:
IsNaN("123abc") //returns true
IsNaN("123") //returns false
IsNaN("999888777123") //returns false
IsNaN("The answer is 42") //returns true
For more information, see Is Finite Method.