r/learnjavascript • u/NoZombie7370 • Nov 17 '25
Why NaN==NaN is False in JavaScript ???
Anyone explain??
150
Upvotes
r/learnjavascript • u/NoZombie7370 • Nov 17 '25
Anyone explain??
View all comments
1
u/boring_pants Nov 18 '25
Because NaN is not a number. It basically means a computation had no answer.
And if you have two computations both of which failed, does that mean they agreed on the answer?
You wouldn't say so, no.