Arrays and Tuples
Work with arrays and tuples in TypeScript.
1
Arrays and Tuples
Welcome to the next lesson! In this lesson, we’ll explore how to work with arrays and tuples in TypeScript. These structures allow you to store multiple values in an organized way. Let’s dive in!

2
What Are Arrays?
An array is a collection of items stored in a single variable. In TypeScript, you can specify the type of elements in an array. Example:
Task: Create an array of your favorite numbers and log it to the console.
let numbers: number[] = [1, 2, 3, 4, 5];
let names: string[] = ["Alice", "Bob", "Charlie"];
console.log(numbers);
console.log(names);
All lessons in this course
- Arrays and Tuples
- Union and Intersection Types
- Enums
- Literal Types