Values & References17 / 18
Up next

Shallow copy shares nested

// a spread copy still SHARES nested objects
const config = { limits: { max: 10 } };
const shallow = { ...config };
shallow.limits.max = 99;
// the original sees the change
console.log(config.limits.max);
What you're solving

a spread copy still shares inner objects