* Iterates over elements of array in reverse invoking callback for each element. * The callback should be passed the element, the current index, and the entire array. code example
Example 1: foreach jas
const array1 = ['a', 'b', 'c'];
array1.forEach(element => console.log(element));
Example 2: javascript foreach
const colors = ['blue', 'green', 'white'];
function iterate(item) {
console.log(item);
}
colors.forEach(iterate);
// logs "blue"
// logs "green"
// logs "white"