TypeScript · Types and shapes
Tuple
A fixed-length array where each position has a type. Optional and rest elements are allowed.
Syntax
[string, number]Example
Example
type Pair = [string, number]; const entry: Pair = ["css", 26];
More in this group
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.