April 2018
Beginner to intermediate
426 pages
10h 19m
English
You have learned that we can iterate an array using the for loop and the forEach method. ES2015 introduced the for..of loop, which iterates through the values of an array. We can take a look at an example of how to use the for..of loop:
for (const n of numbers) {
console.log(n % 2 === 0 ? 'even' : 'odd');
}