3 ms·
NaN !== NaN Apart from that, I agree.
by ryanbraganza 15y ago
NaN !== NaN
Apart from that, I agree.
- OriginalSyn 15y agoSure but at least the spec is clear that NaN always returns false.
- jQueryIsAwesome 15y agoThat is the reason for the existence of the function isNaN. Plus, NaN returns a generated object, so that result is expected ({}) !== ({})
- tikhonj 15y agoThat's not really language dependent--that's how floating point numbers always work. And with good reason--there are actually a ton of different NaN bit patterns in the floating point standard. I think anything where the exponent is all 1 is an NaN (except maybe for infinity--I don't remember the exact details). The point is that two completely different patterns of bits can be NaN.