Frontend & browser·JavaScript in the browser
you compared the two API responses field by field, all the way down, to decide whether to update.
Deep equality
Also calleddeep compare, structural equality
Recursively comparing every nested value to decide whether two structures are equivalent. It gives the answer people intuitively want, at a cost proportional to the size of the data — and on a hot path that comparison can exceed the render it was meant to avoid. Cycles, dates, maps and undefined-versus-missing keys all make correct implementations subtler than they look.