An array method that executes a provided function once for each array element.
const numbers = [1, 2, 3, 4];
numbers.forEach(function(number) {
console.log(number);
});
- Takes a callback function to execute for each element.
- The callback can take up to three arguments: the current element, the index of the current element, and the array itself.