NaN === false => false, isn\'t NaN falsy?NaN === NaN => false, but !!NaN === !!NaN => trueI\'v
=== compares both type and value.
Even though NaN is falsey, === wouldn't be the way to compare it. Something is "falsey" if it evaluates to false in a boolean expression. That isn't the same as being equal to (or equivalent to) false.
For example, null == false returns false, even though null is falsey. This is not completely intuitive, but that's just how JavaScript handles false/falsey values.
0 and the blank string ("") are special cases where value equality comparisons against false evaluate to true (i.e. 0 == false and "" == false). However, 0===false and ""===false still returns false.
NaN is special in that it doesn't have a real value, so comparing it to itself doesn't return true. Essentially, NaN is equal to nothing, not even NaN.
The only way to reliably compare something to NaN is using isNaN( value ).
To your second point, !value is a boolean expression. value first undergoes type coercion to a boolean (and remember, NaN is falsey) and then the boolean NOT ! makes it true. As it happens, it's double negated, so !!NaN is the same as boolean false. Of course false === false, so the expression evaluates to true.