A custom comparison method decides whether two values should count as equal according to their contents or domain meaning. This matters when JavaScript objects represent virtual nodes: two separate objects can describe the same node, even though === returns false. section 7.6.4
Use the comparison method as the equality policy for an array-diff algorithm:
- Pass equalsFn into the array wrapper and default it to (a, b) => a === b for primitive-value tests. section 7.6.4
- Use equalsFn when detecting removals, no-op matches, additions, and moved items. section 7.6.4
- Keep comparison separate from array mutation so the same diff mechanism can work with strings or virtual nodes. section 7.6.4
Reference identity versus value equality
const a = { foo: 'bar' } const b = { foo: 'bar' } console.log(a === b) // false A custom comparator can instead treat these objects as equal when their relevant properties match. section 7.6.4

