EasyType Coercion💻 Output Question

NaN is not equal to anything including itself

💡

Hint

NaN !== NaN always. Number.isNaN() is strict (no coercion). isNaN() converts first.

What does this output?

console.log(NaN === NaN);
console.log(NaN == NaN);
console.log(isNaN('hello'));
console.log(Number.isNaN('hello'));

Correct Output

false
false
true
false

Why this output?

Explanation: NaN is the only value not equal to itself. isNaN("hello") coerces to NaN first (true). Number.isNaN doesn't coerce — "hello" is not NaN (false).

Key Insight: NaN !== NaN always. Number.isNaN() is strict (no coercion). isNaN() converts first.

More Type Coercion Output Questions

EasyPlus operator: string concat vs numeric addMediumLoose equality edge cases with nullEasytypeof for common valuesMediumTruthy and falsy — empty array and object are truthy

Practice predicting output live →

66 output questions with instant feedback

💻 Try Output Quiz