NaN is a number. Seriously. The property that specifically means “not a number” is a number:
console.log(typeof NaN); // number
So if you want to check whether a variable is not a number, you should use the
isNaN() function instead. I honestly have no idea why the
NaN property exists at all, except as a really bad joke.