0 of 10 problems solved • 0%
Use in a course

Looping Through Arrays

10 exercisesEasy

Loops let one piece of logic visit every value in an array. A for...of loop focuses directly on the items, which makes it a readable choice for totals, counts, and searches.

const scores = [8, 10, 7]; let total = 0; for (const score of scores) { total += score; } console.log(total); // 25

The first exercises inspect each item, accumulate results, count matches, and build new arrays manually. Seeing the steps explicitly prepares you to understand the array methods that automate these patterns later.