This lesson explains the record mapped type.

Description of Record

The Record type is also one of TypeScript’s default mapped types. The Record type is a way to build a new type with several members of a single type. For example, if you need an object with three members of type string, you could do it like line 2. The first parameter takes a union of desired fields and the second parameter is the type of these fields. Line 2 defines m1, m2, and m3 that are all of the type string.

Get hands-on with 1200+ tech skills courses.