3 ms·
The "Harmony" proposal for the next JavaScript spec includes Number.isNaN, which is meant to be a less-confusing version (with no type coercion). It's currentl
by mbrubeck 14y ago
The "Harmony" proposal for the next JavaScript spec includes Number.isNaN, which is meant to be a less-confusing version (with no type coercion). It's currently implemented in Firefox Nightly builds: http://bugzil.la/749818 http://bugzil.la/749818
Number.isNaN(NaN) => true
Number.isNaN(3e2) => false
Number.isNaN("NaN") => false
Number.isNaN("string") => false
Number.isNaN({}) => false
Number.isNaN("3e2") => false
Number.isNaN([]) => false
http://wiki.ecmascript.org/doku.php?id=harmony:number.isnan http://wiki.ecmascript.org/doku.php?id=harmony:number.isnan