Determines whether a supplied number is NaN (not a number).
SyntaxisNaN(numValue)
true if the value, converted to the Number type, is the NaN; otherwise false.
ExamplesisNaN(100);
isNaN("100");
isNaN("ABC");
isNaN("10C");
isNaN("abc123");
isNaN(Math.sqrt(-1));
Remarks
You typically use this method to test return values from the parseInt and parseFloat functions.
Alternatively, a variable that contains NaN or another value could be compared to itself. If it compares as unequal, it is NaN. This is because NaN is the only value that is not equal to itself.
See also Other articles AttributionsMicrosoft Developer Network: Article
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4