Phase 7 · TypeScript
TopicsMapped Types
Part of the Frontend Developer Roadmap.
Summary
Types that programmatically transform every property of an existing type (e.g. making them all optional or readonly) using a `[K in keyof T]` syntax.
How to Learn This
- 1Write a simple mapped type that makes every property of an interface optional.
- 2Compare your hand-written version to the built-in `Partial<T>` utility.
- 3Learn key remapping (`as`) for renaming properties in a mapped type.
More topics in TypeScript
Stuck on this topic? Ask an Insider
Get 1:1 guidance from people who've walked this exact path — free on the InsideEdge app.