A quick way to deep clone is stringify then parse. This creates completely independent copies of nested structures.
const original = { a: { b: 1 } };
const clone = JSON.parse(JSON.stringify(original));
clone.a.b = 99;
console.log(original.a.b); // 1 (unchanged)
Note: This doesn't work with functions, undefined, or circular references.