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 || (isNaN(val1) && isNaN(val2)))
Nothing to improve. Just add the parentheses to make it clear to everyone.