News for hackers. Stuff that matters.
Re:WTFJS? by kevingadd on Friday February 12, 2010 @05:52PM (#1122043)
What benefit is created by having a hierarchy of comparison operators in which there is no actual way to compare two numbers for semantic (not numeric) equivalence?

If (NaN == NaN) == false, and (NaN === NaN) == false, how would you implement an isNaN() function? If your answer is 'depend on the VM', I find that a bit strange.

Re:WTFJS? by pmjordan on Friday February 12, 2010 @06:15PM (#1122093)
typeof(NaN) should still be 'number', which would identify it uniquely. The irony of the value "Not a Number" having type "Number" is not lost on me, however.
Re:WTFJS? by alextp on Friday February 12, 2010 @06:18PM (#1122102)
function isNaN(x) { return x != x; };