forEach modify array JavaScript

JavaScript
arr.forEach(function(part, index) {
  this[index] = "hello world";
}, arr); // use arr as this

Source

Also in JavaScript: