All academies
All challenges

Implement Pick and Omit from Scratch

hardutility-types200 XP

Problem

Rebuild two built-in utility types yourself: MyPick<T, K> must produce an object type with only the keys in K, and MyOmit<T, K> must produce one with those keys removed. Use a mapped type for MyPick and combine it with the built-in Exclude for MyOmit. The demo values below must type-check against your implementations exactly as they would against the built-ins.

Expected output

Learn mapped types
false
2

Hints

Stuck? Reveal hints one at a time.

Solution

Try solving it yourself first — revealing is always available.

Press Run in the editor — your console output is checked automatically.
No errors
Loading...

Console output appears here. Press Run or just type — the code compiles automatically.