title: isNaN not working JavaScript
body: <p>I’m having trouble with the isNaN function is JavaScript. I have a variable, trc, which I know is not a number, but I want my code to be able to tell. Unfortunately, isNaN isn’t detecting that it’s not a number, yet when I use an alert to show the value of the variable, it is indeed not a number.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>trc = parseInt(getCookie("trc"));
  cnn = parseInt(getCookie("cnn"));
  klove = parseInt(getCookie("klove"));
  if (isNaN(trc)) {
    trc = 0;
  }
  if (getCookie("trc") == undefined) {
    trc = 0;
  } else {
    trc = parseInt(getCookie("trc"));
  }
  alert(trc);</code></pre>
  </div>
  </div>
  </p>
  
  <p>BTW, I have a separate function, getCookie(), that I made myself to get the value of a cookie.</p>