Answer
JSON.parse(JSON.stringify(obj)) is the quick deep copy, but it drops/breaks:
undefined, functions, and symbols (omitted).Datebecomes a string,Map/Setbecome{}.NaN/Infinitybecomenull.- Circular references throw.
BigIntthrows.
Use structuredClone(obj) (modern, handles cycles, Date, Map/Set) or a manual recursive copy.