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
- Your code has no type errors
- The console prints
0 2 3 - A
Lockedvalue can't be changed - A
Completevalue must havebio - An
Optionalvalue may be empty - No built-in
Partial,ReadonlyorRequired
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.