All academies
All challenges

Patch Settings with Partial

easyutility-types50 XP

Problem

Given an interface Settings with theme (string), fontSize (number), and autosave (boolean), write updateSettings(current: Settings, updates: Partial<Settings>): Settings. It must return a new object where any provided fields override the current ones, and callers may pass as few or as many fields as they like.

Expected output

dark / 14
false

Hints

Stuck? Reveal hints one at a time.

Solution

Try solving it yourself first — revealing is always available.

Press Run in the editor — your console output is checked automatically.
No errors
Loading...

Console output appears here. Press Run or just type — the code compiles automatically.