labeled tuple element
A name written before a tuple position, such as [latitude: number, longitude: number], that documents what each slot means.
In more detail
The labels do not change the type; they show up in editor tooltips and make mixing up positions less likely. Either all elements of a tuple are labeled or none are.
Related terms
- tuple — An ordered, fixed-length group of values in which each position can have its own meaning and type.
- tooltip — A small text label that appears when a control is hovered or focused, describing it briefly.
Taught in
- Tuples: Fixed Length, Labeled Elements And Variadic Tuples — Production TypeScript