Object spread copies properties into a new object.
const original = { theme: "dark" };
const copy = { ...original };{ ...original } creates a separate object with the same properties.copy.theme to "light" leaves original.theme equal to "dark".This is a shallow copy: nested arrays or objects would still be shared.
Replace the direct assignment with a spread copy, then change only profileCopy.city to Umeå. Display both cities.
A spread copy gives the update a different object to change.