Hint
NaN !== NaN. Always use Number.isNaN() not isNaN() β isNaN coerces its argument first.
console.log(NaN == NaN);
console.log(NaN === NaN);
console.log(NaN != NaN);
console.log(Number.isNaN(NaN));
console.log(isNaN('hello'));false false true true true
Explanation: NaN is the only value not equal to itself (both == and ===). Use Number.isNaN() for reliable check. Legacy isNaN() coerces first β isNaN("hello") converts "hello" to NaN then returns true.
Key Insight: NaN !== NaN. Always use Number.isNaN() not isNaN() β isNaN coerces its argument first.