N
var colors = ['red', 'blue', 'green'];
colors.forEach(function(color) {
console.log(color);
});
N
const array1 = ['a', 'b', 'c'];
array1.forEach(element => console.log(element));
N
Used to execute the same code on every element in an array
Does not change the array
Returns undefined