TypeScript / Lesson 8. Tuples

Опубликовано: 16 Март 2026
на канале: Игорь Антонов — про JavaScript и разработку
510
40

🧩 What is a tuple?

A tuple is an ordered set of fixed length, where each element has a predefined type. In TypeScript, tuples are represented by fixed-length arrays with element types specified at definition time.

🔍 Features of Tuples

1. Unlike regular arrays, tuples allow you to store elements of different types.
2. The length of a tuple is known in advance and cannot be changed after creation*.
3. TypeScript ensures that tuple elements match their types.

For more details and nuances, see the lesson. Enjoy watching 🍿

📚 Contents

00:00 Introduction to Tuples
03:18 When to Use Tuples
04:16 Theory Summary
05:04 Tuples in Practice
08:44 Tuples and Immutability
10:45 Tuple Nuances
13:36 The Rest of Types
15:33 An Alternative Way to Declare Tuples
16:51 Summary

☝️ Useful Links

https://www.typescriptlang.org/docs/h... — Official Documentation