+ 3
What is NaN?
JavaScript
5 Answers
+ 11
It is a JavaScript value which results from nonsensical operations. Example: 0 / 0 or a number divided by a string or vice versa in which the string can't be coerced to a number.
It also worth to note that, NaN is the only value or type that even yields false when compared to itself. e.g
NaN == NaN. // false
NaN === NaN // false
+ 17
NaN is "Not a Number".
5/'d' = NaN
'd'/6 = NaN
Type of NaN is a number (funny though).
NaN is a falsely value.
Javascript return NaN if it couldn't convert something to a number or that thing isn't a number itself.
+ 14
@Ben Bright, is NaN the only type that yield false when compared to itself?
What of this:
obj1 = {};
obj2 = {};
obj1 == obj2; // false
+ 9
@Wisdom I said so because contents of objects are compared by references. And every single created object has a different reference so even if you compare the same objects it yields false.
0
Nan = Not A Number



