In JavaScript, arrays are one of the most common data structures you will manipulate.
An array is an ordered list of values, each stored at a numbered position called an index.
The first element is always at index 0, the second at index 1, and so on.
To process every element of an array, you need loops.
A loop lets you repeat a block of code multiple times without writing it again by hand.
In this chapter, we will study three ways of looping over arrays.
The classic for loop, the modern for, of loop, and the while loop.
Each has its own strengths, and knowing when to use which is a core developer skill.
Read the full transcript.
Create an account to read the whole episode, search across every transcript, and follow the shows you care about.
In JavaScript, arrays are one of the most common data structures you will manipulate.
An array is an ordered list of values, each stored at a numbered position called an index.
The first element is always at index 0, the second at index 1, and so on.
To process every element of an array, you need loops.
A loop lets you repeat a block of code multiple times without writing it again by hand.
In this chapter, we will study three ways of looping over arrays.
The classic for loop, the modern for, of loop, and the while loop.
Each has its own strengths, and knowing when to use which is a core developer skill.