#3 Equality - Lessons Learned While Reading "Effective Javascript"

What are numbers equal to when they don't have proper values?
 
null = 0
undefined = NaN
 
How would you test if a number is NaN?
If your answer was "x == NaN", you'd be wrong. The IEEE floating point standard requires that NaN be unequal to itself. More info on the NaN wikipedia entry
 
Using that quirk to your advantage, you can simply do:
 
x !== x // If x is NaN, then this will be true.
 
Bonus hint:
Weird non-equality related hint: ".valueOf" trumps ".toString" for string concatenation of objects.