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
- Your code has no type errors
- The console prints
false - Assigning
undefinedtovolumeis still rejected - The
Settingsinterface 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.
Press Run to see the page.
Console
Nothing printed yet.