12 ms·
"== - '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 ar
by janzer 17y ago
"== - '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.