JSConf JP

Object Comparison and Identity: From Comparisons to Composites

LTTrack AJapanese

JavaScript does not currently provide a standard way to compare objects based on their contents; equality checks determine identity instead. Developers therefore implement their own deep-comparison logic or account for behavior that differs from primitives when using objects as Map keys or Set values.

TC39 has recently discussed proposals such as Comparisons and Composites for these problems. Although they overlap in the areas of object comparison and Map/Set semantics, they have different targets and approaches. This LT introduces both proposals and contrasts how they address object comparison and identity.