News for hackers. Stuff that matters.
Re:Deep Cloning Objects in JavaScript, the Modern Way by jv22222 on Thursday December 21, 2023 @08:14PM (#38729649)
> Can anyone describe a compelling use case for "deep cloning" objects in JavaScript

Hierarchical data structures, in mindmaps, menu structures, block based notes apps, etc.

Re:Deep Cloning Objects in JavaScript, the Modern Way by niedzielski on Thursday December 21, 2023 @10:45PM (#38730733)
I agree. I had this same problem with a tree UI model. Each node had links to both the children and the parent. Mutating any node in the tree, changes the reference of that node. Mutating the linkage to the updated node cascades to every other node in the tree.