I can't seem to understand why when I put in the console
isNaN == true results to false while !isNaN == false returns to true.
When
NaN == true
false
NaN == false
false
Sorry I'm kinda new and somewhat confused.
I can't seem to understand why when I put in the console
isNaN == true results to false while !isNaN == false returns to true.
When
NaN == true
false
NaN == false
false
Sorry I'm kinda new and somewhat confused.
isNaN is a function which determines if the value is NaN. So isNaN will check if the input is a number or not .
For example isNaN(5) == true will return false , because 5 is a number, Simillarly for empty string isNaN('') == true will also return false it is not a number.
But for isNaN('Hello') == true will return true, since 'Hello' is not a number
Now when using negation(!) it will work oppositely