TypeScript · Types and shapes

Record

An object whose keys and values share types.

Syntax
Record<string, number>

Example

Example
const scores: Record<string, number> = { html: 90, css: 85 };

More in this group

any Array types enums Function type Interface Literal type never null and undefined

Learn this in the course

Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.

Open the course