// Using forEach() (in‑place modification)
const numbers = [5, 10, 15, 20];
// Modify the array in place
numbers.forEach((value, index, arr) => {
arr[index] = value * 2;
});
// With forEach() we do something with each element
// rather than return a new array.
console.log(numbers);
/*
run:
[10, 20, 30, 40]
*/