Seth Seth - 3 years ago 75
Javascript Question

How do you check if something is NaN and it is not equal to a string? (SOLVED)

Thank you everyone that helped.

Answer Source

you could use ParseInt() to change the string into an integer

    function printIsNaN(value) {
  var bool = document.getElementById("booleanValue");
  if (isNaN(parseInt(value))) {
    console.log("nope");
  } else if (!isNaN(parseInt(value))) {
    console.log("yep");
  }
}

hope this helps

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download