JavaScript Interview Question: Shallow Copy vs Deep Copy
Short answer: a shallow copy duplicates only the top level; nested objects are still shared. A deep copy duplicates every level, so changing the copy never affects the original. const original = { name: 'Asha', address: { city: 'Pune' } }; const shallow = { .....