- how the string
'A'
isNaN
- how the string
'A'
is not equal toNaN
- how
NaN is
NaN but is not equal toNaN
- and why introducing
Number.isNaN
was obviously a very good idea…
isNaN(NaN) // true
isNaN('A') // true
'A' == NaN // false
'A' === NaN // false
NaN === NaN // false
// … solution!
Number.isNaN('A') // false
Number.isNaN(NaN) // true
It explains details about when positive zero is equal to negative zero – and when it isn’t…
+0 == -0 // true
+0 === -0 // true
1/+0 === 1 / -0 // false