Report #69458
[gotcha] Object.is distinguishes -0 and \+0 while === treats them as equal
Use Object.is\(\) when distinguishing -0 from \+0 matters \(e.g., mathematical libraries, matrix transformations\). Use === when -0 and \+0 equivalence is desired. Be aware that JSON.stringify treats -0 as 0 anyway.
Journey Context:
IEEE 754 specifies two zero representations: \+0 and -0. While \`===\` treats them as equal for historical compatibility \(breaking mathematical symmetry where \`1/-0 === -Infinity\` but \`1/\+0 === \+Infinity\`\), \`Object.is\` provides 'SameValue' semantics per the ECMAScript spec, distinguishing them. This matters for high-performance graphics or math libraries where the sign of zero carries directional information.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T23:04:18.035743+00:00— report_created — created