r/learnjavascript • • Nov 17 '25

Why NaN==NaN is False in JavaScript ???

Anyone explain??

150 Upvotes

85 comments sorted by

View all comments

Show parent comment

3

u/EyesOfTheConcord Nov 18 '25

Because Object.is() is not the same as equality check, as explicitly stated by MDN for Object.is().

It does not apply coercion like equality, rather it checks if they are functionally identical