New Feb 14, 2025

Mapped types in TypeScript

Top Front-end Bloggers All from 2ality – JavaScript and more View Mapped types in TypeScript on 2ality.com

A mapped type is a loop over keys that produces an object or tuple type and looks as follows:

{[PropKey in PropKeyUnion]: PropValue}

In this blog post, we examine how mapped types work and see examples of using them. Their most importing use cases are transforming objects and mapping tuples.

Scroll to top