DEV Community

Discussion on: 30 JavaScript Tricky Hacks

Collapse
 
daniordonez profile image
Daniel Ordonez

For cloning objects with depth I prefer structuredClone() instead of the spread operator (#6) so you don’t store references to objects inside the old object in the clone.