Problem Statement
Which statement about Object.assign and spread {...obj} is true?
Explanation
Object.assign and object spread create a new object but copy references for nested objects.
To deeply clone, you need a custom routine, a library, or structuredClone (for supported types).
Code Solution
SolutionRead Only
const a = { n: 1, inner: { x: 10 } };
const b = { ...a };
b.inner.x = 99;
console.log(a.inner.x); // 99 (shallow copy)