0 of 8 problems solved • 0%
Use in a course

Exercise prompt

Copy an Object with Spread

Object spread places an existing object's properties into a new object. The two outer objects are separate values.

Example

const original = { theme: "dark" }; const copy = { ...original };

Your task

Replace the direct assignment with a spread copy, then change only profileCopy.city to Umeå. Display both cities.

Hint

A spread copy gives the update a different object to change.