Iterating over an Array
Learn how to iterate over the array to access its contents using loops.
We'll cover the following...
There are several ways to browse an array element by element. The first is to use a for
loop as discussed previously.
Press + to interact
const movies = ["The Wolf of Wall Street", "Zootopia", "Babysitting"];for (let i = 0; i < movies.length; i++) {console.log(movies[i]);}
The for
loop runs through each element in the array starting with index 0 all the way ...