The equals helper function is used to compare two objects. It can be useful in some situations, but it can have its own pitfalls. The most common of these has to do with similar, but not equal, values that result in the same serialized string. This is because arrays and objects in JavaScript are compared by reference.

2m read timeFrom 30secondsofcode.org
Post cover image
Table of contents
Equality comparisonJSON.stringifyDeep equality comparison
1 Comment

Sort: