| ★ wanayoo — archive 1999 http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number/NaN | Nouvelle recherche | Portail wanayoo |
A value representing Not-A-Number.
| Property of Number | |
| Implemented in: | JavaScript 1.1, NES 2.0 |
| ECMA Version: | ECMA-262 |
The value of Number.NaN is Not-A-Number, same as the value of global object's NaN property.
NaN is always unequal to any other number, including NaN itself; you cannot check for the not-a-number value by comparing to Number.NaN. Use the isNaN function instead.
Several JavaScript methods (such as the Number constructor, parseFloat, and parseInt) return NaN if the value specified in the parameter can not be parsed as a number.
You might use the NaN property to indicate an error condition for your function that returns a number in case of success.
JavaScript prints the value Number.NaN as NaN.
Page last modified 18:03, 14 Apr 2007 by Mgjbot