Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

Deep equality

3 tags 1 category

Deep equality is a comparison of compound values, such as objects or arrays, that compares their contents recursively. Two separate objects can be deeply equal even though they are not the same object. In contrast, an identity comparison asks whether two references refer to one object.

Deep equality implementations usually compare two objects recursively like so:

1. The two objects have the same type. The prototype objects may or may not be compared deeply (and usually they are not), but for example an Array should never be deeply equal to a plain object. 2. For each own property of one object, a property with the same key exists on the other object, with deeply equal values. If the values are primitives, they are equal by value. 3. Any data that’s not exposed as properties, such as Map, is deeply compared, provided that the implementation recognizes the object type and knows how to retrieve the data. 4. Usually there’s some support for circular references.

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…