modify data in array using foreach loop js code example
Example: forEach modify array JavaScript
arr.forEach(function(part, index) {
this[index] = "hello world";
}, arr); // use arr as this
arr.forEach(function(part, index) {
this[index] = "hello world";
}, arr); // use arr as this