News for hackers. Stuff that matters.
Re:WTFJS? by janzer on Friday February 12, 2010 @05:53PM (#1122046)
"== - 'values are equal' - in this case, are these two numbers equal? The IEEE spec would say no." "=== - ...are both the values and types..."

If the values are not equal, how can both the values and types be?

Looking at the ECMAScript 5 standard even if you take out the explicit handling of NaN in the === (Strict Equality) definition it should still evaluate to false since the next subrule compares the numeric value.

4.If Type(x) is Number, then a.If x is NaN, return false. b.If y is NaN, return false. c.If x is the same Number value as y, return true.

There are no comments on this comment yet.