Command Palette

Search for a command to run...

Hectal
Phase 16: Advanced TypeScript
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

  1. Your code has no type errors
  2. The program prints dark 12
  3. A wrong mode is still rejected
  4. 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.

Console

Nothing printed yet.