Phase 7 · TypeScript

Topics

Mapped 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.
InsideEdge

Stuck on this topic? Ask an Insider

Get 1:1 guidance from people who've walked this exact path — free on the InsideEdge app.

Download
InsideEdge