Never miss a beat

Join my newsletter.

Tag: tuple

TypeScript Tuples

Published: 4/9/2020

TypeScript offers a plethora of types for developers to leverage, but some of the types may be ones that you’re unfamiliar with. Take the tuple, for example. JavaScript doesn’t have a concept of tuples , so figuring out how and when to use one might feel tricky. Thankfully, Tuples are pretty simple and are used by popular frameworks, like React. What is a tuple? Tuples allow you to express an array with a fixed number of elements of which each element may be of a different type. For example…