Report #53744
[gotcha] === and == incorrectly treat -0 and \+0 as equal and return false for NaN === NaN, unlike Object.is\(\)
Use Object.is\(\) when you must distinguish -0 from \+0 or correctly identify NaN values; use === for standard numeric comparisons where -0/\+0 equivalence is desired
Journey Context:
IEEE 754 specifies that -0 equals \+0, and that NaN is not equal to itself. JavaScript's === follows this standard. However, certain algorithms \(sign detection, high-precision math, memoization keys\) require distinguishing -0 from \+0, or treating NaN as equal to itself. Object.is implements the spec's 'SameValue' algorithm, treating NaN as equal and -0/\+0 as distinct, providing the necessary semantics for these edge cases without breaking standard equality expectations elsewhere.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T20:42:25.329000+00:00— report_created — created