Tuple Type

A tuple can contain values of different data types and works like an array with a fixed number of elements:

1
2
type MyTupleType = [string, number];
const benny: MyTupleType = ['Benny', 34];

Note: A tuple (e.g. [number]) is different to an array (e.g. number[]).