3 ms·
But for `Objects` (not primitves) it is the identity comparison operator, right?
by XCSme 8y ago
But for `Objects` (not primitves) it is the identity comparison operator, right?
- kccqzy 8y agoI wasn't aware of that. I thought ES2015 added Object.is() for this purpose: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
- AgentME 8y agoThe main difference between === and Object.is() is that === treats +0 and -0 as equivalent, despite the fact that some math operations treat them differently. I think they added Object.is() because it was awkwardly difficult to make code tell the difference between +0 and -0.
- scottmf 8y agoYes
- ZenPsycho 8y agotechnically for primatives too, since they are interned, immutable and their value is their identity?