Code Snippet
const original = { prefs: { volume: 3 } };
const copy = { ...original };
copy.prefs.volume++;
copy.prefs = { ...copy.prefs, volume: 9 };
console.log(original.prefs.volume, copy.prefs.volume);
console.log(original.prefs === copy.prefs);
Expected Output & Explanation
4 9
false
The first mutation uses the shared nested object. The later spread assigns a different nested object to copy only.
Module Context & References
Personal Notes · Markdown
Technologies & Interview Topics Covered
Switch between short-term interview tracks and long-term 80/20 engineering depth to
practice JavaScript internals, React rendering and hooks, timed frontend machine
coding UI challenges, MeetaPro FG300, Blind 75 & NeetCode 150 DSA patterns,
Python & FastAPI APIs, PostgreSQL query optimization & MVCC, Redis caching,
Applied AI RAG pipelines & evaluations, and distributed system design.