Hacker News new | ask | show | jobs
by crazy2be 3443 days ago
You mean NaN != NaN. null == null is true, and null != null is false.

NaN != NaN is surprising, but is not unique to JavaScript. As far as I know, this is the case in every language, and is mandated by the IEEE 754 specification.

However, it does come up in JavaScript more often than other places, since NaN is really easy to get (+{} => NaN, 1 - '' => NaN, etc, etc).