Iteration methods let you work with every item in an array. This lesson pairs forEach() and map() so learners can compare a side-effect loop with a transformation method.
const numbers = [1, 2, 3];
const labels = [];
numbers.forEach((n) => labels.push(`Number: ${n}`));
const doubled = numbers.map((n) => n * 2);
Use forEach() to push formatted labels into an existing array.