In JavaScript, two objects cannot be equal even though they are similar in JavaSCript. In the case of objects, you are comparing the references (the addresses) and not the exact values.

4m read timeFrom freecodecamp.org
Post cover image
Table of contents
Primitive and Reference ValuesComparing Primitive and Reference ValuesHow to compare objectsWrap up
11 Comments

Sort: