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

Exercise prompt

Repair an Immutable Object Update

An immutable object update creates a new object and places changed properties after the original spread so they override old values.

Example

const original = { theme: "light", compact: false }; const updated = { ...original, theme: "dark" };

Your task

The starter mutates settings, so both variables end up with a dark theme. Replace the two update lines with one immutable spread update. The output must show Original: light and Updated: dark.