Command Palette

Search for a command to run...

Hectal
Phase 12: The Compiler and tsconfig
TypeScript · Exercise 5 of 6 PreviousNext
Intermediate

Missing Is Not undefined

exactOptionalPropertyTypes is on (it comes from tsc --init): volume?: number means the key may be absent, not that it may hold undefined. mute assigns undefined, which the checker rejects.

Fix mute so that after it runs the key volume is really gone: the console must print false. Don't change the Settings interface.

What Check tests

  1. Your code has no type errors
  2. The console prints false
  3. Assigning undefined to volume is still rejected
  4. The Settings interface is unchanged

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.