Re:WTFJS?
by knome on Friday February 12, 2010 @05:49PM
(#1122038)
> In this case, the answer is yes, absolutely.
No, it isn't, absolutely.
`===` means that javascript does a normal equality test, whether it be string comparison or numerical comparison, but without any type conversion. It means that while `"3" == 3` is `true` when you execute `"3" === 3"` it is false.
Given two `NaN`s, it would see they're both floats, do a floating point comparison, and return `false`. As it should.
No, it isn't, absolutely.
`===` means that javascript does a normal equality test, whether it be string comparison or numerical comparison, but without any type conversion. It means that while `"3" == 3` is `true` when you execute `"3" === 3"` it is false.
Given two `NaN`s, it would see they're both floats, do a floating point comparison, and return `false`. As it should.