JavaScript Quiz Practice
Active Recall Drill Session
← Exit SessionQuestion 1 of 1
mediumJavaScript
Does this shallow-copy update correctly leave the original untouched?
code
const user = { name: 'Ada', address: { city: 'London' } };
const updated = { ...user };
updated.address.city = 'Paris';
console.log(user.address.city);