JavaScript objects: Memory references, clones, and gotchas

A deep dive into how JavaScript handles objects in memory, covering reference assignment, nested objects, shallow cloning with spread syntax, and the subtle gotchas that cause unexpected mutations