title: What causes isNaN to malfunction?
body: <p>I'm simply trying to evaluate if an input is a number, and figured <code>isNaN</code> would be the best way to go. However, this causes unreliable results. For instance, using the following method:</p>
  
  <pre><code>function isNumerical(value) {
      var isNum = !isNaN(value);
      return isNum ? "&lt;mark&gt;numerical&lt;/mark&gt;" : "not numerical";
  }
  </code></pre>
  
  <p>on these values:</p>
  
  <pre><code>isNumerical(123));     // =&gt; numerical
  isNumerical("123"));   // =&gt; numerical
  isNumerical(null));    // =&gt; numerical
  isNumerical(false));   // =&gt; numerical
  isNumerical(true));    // =&gt; numerical
  isNumerical());        // =&gt; not numerical
  </code></pre>
  
  <p>shown in this fiddle: <a href="http://jsfiddle.net/4nm7r/1" rel="noreferrer">http://jsfiddle.net/4nm7r/1</a></p>
  
  <p><strong>Why doesn't <code>isNaN</code> always work for me?</strong></p>