Command Palette

Search for a command to run...

Hectal
Phase 8: Type Operators
TypeScript · Exercise 4 of 5 PreviousNext
Intermediate

Optional, locked and complete: three mapped types

Write three mapped types and use them on Profile:

Optional<T> makes every property optional. Locked<T> makes every property read-only. Complete<T> makes every property required, including the optional ones (use -?). Don't use the built-in Partial, Readonly or Required.

What Check tests

  1. Your code has no type errors
  2. The console prints 0 2 3
  3. A Locked value can't be changed
  4. A Complete value must have bio
  5. An Optional value may be empty
  6. No built-in Partial, Readonly or Required

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.