TypeScript · Exercise 1 of 6Next
Intermediate
Make a widened object fit its target
apply(config) is refused because config.mode was widened to string. Change **only the definition of config** so the call compiles.
Do not use as Mode or any other cast except as const, and do not change apply. The program must still print dark 12.
What Check tests
- Your code has no type errors
- The program prints dark 12
- A wrong mode is still rejected
- No cast except as const
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
Runs in your browser. Your code is saved here.
Press Run to see the page.
Console
Nothing printed yet.