What will the console.log(NaN === NaN) statement output?
a)
true
b)
false
c)
undefined
d)
NaN
Answer:
b)
false
Explanation:
In JavaScript, NaN
(Not-a-Number) is a special value that represents an undefined or unrepresentable number. When comparing NaN
with itself using ===
, the result is false
. This is because NaN
is not considered equal to anything, even itself.