title: Comparing NaN values for equality in Javascript
body: <p>I need to compare two numeric values for equality in Javascript. The values may be <code>NaN</code> as well.
  I've come up with this code:</p>
  
  <pre><code>if (val1 == val2 || isNaN(val1) &amp;&amp; isNaN(val2)) ...
  </code></pre>
  
  <p>which is working fine, but it looks bloated to me. I would like to make it more concise. Any ideas?</p>