title: Check if input is number in JavaScript by comparing with NaN without using isNaN()
body: <p>I tried to check if the input entered by a user is a number or not with the code below. It didn't work.</p>
  
  <pre><code>var a = Number(prompt("Enter a number"));
  if (a !== NaN) {
      console.log("yes");
  }
  else {
      console.log("no");
  }
  </code></pre>
  
  <p>I tried printing the value of a when the input wasn't a number and the output was NaN. But still, this code doesn't work. I know I can use isNaN(), but why doesn't my code work? And is there some other way to check if the input is a number without using isNaN()?</p>