title: why does isNaN always return true
body: <p>Having some trouble trying to validate strings that are numbers in JS. isNaN in particular seems to be misbehaving.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
  &lt;meta charset="utf-8"&gt;
  &lt;title&gt;No Quirks!&lt;/title&gt;
  &lt;/head&gt;
       &lt;body&gt;
          &lt;h1&gt;JavaScript Test&lt;/h1&gt;
  
          &lt;button onclick="myNanIsTrue()"&gt;Is it a number?&lt;/button&gt;
  
          &lt;p id="writeToHTML"&gt;&lt;/p&gt;
  
          &lt;script type="text/javascript"&gt;
          function myNanIsTrue() {
               var g = parseInt("40000000") + "&lt;br /&gt;";
               var n = g;
               if (isNaN(g)){
                    g="moo!";
               }
               n += g + "&lt;br /&gt;";
               document.getElementById("writeToHTML").innerHTML = n;
          }
          &lt;/script&gt;
       &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Tried a couple of permutations of this but it just doesn't seem to be working. Can anyone see why this isn't working? </p>