I need to compare two numeric values for equality in Javascript. The values may be NaN as well. I\'ve come up with this code:
NaN
if (val1 == val2 |
if ( val1 === val2 )
If either one or both are NaN it will evaluate to false.
Also, NaN !== NaN
NaN !== NaN