0
0
Read Time:13 Second
The forEach()
method calls a function for each element in an array.
The forEach()
method is not executed for empty elements.
const numbers = [65, 44, 12, 4];
numbers.forEach(myFunction)
function myFunction(item, index, arr) {
arr[index] = item * 10;
}