To quote from Dmitry Soshnikov's Note 2. ECMAScript. Equality operators,
if one of the operands in a non-strict comparison is a
second operand will always be converted to a number.
In this case,
typeof NaN === 'number', so
1 before the comparison. Neither is equal to
This pitfall is avoided entirely with strict equality (