Why does Number.isNaN("he") give false
instead of true
seeing that "he" is a string and not a number; but then Number.isNaN(NaN), only, gives true and nothing else give true? What is then the essence of this function?
Reading through mdn, I see that The Number.isNaN() method determines whether the passed value is NaN and its type is Number. Now I'm starting to think of a value whose value is NaN but has a type Number. I understand the usecase of isNaN(). I also want to know in what scenario one is to use Number.isNaN().
// this works well
isNaN("7") //false works as expected
isNaN("Hello") // true works as expected
Number.isNaN(NaN) // true works as expected
Number.isNaN("hello") // false wasn't expecting this