var arr = [\'Foo\']; arr.forEach(function(item){ console.log(item); item = \'Lorem\'; console.dir(arr[0]); }); for (var item in arr){ arr[item] = \'Ipsum\
Notice that callback in forEach gets three arguments. The second one being an index of current element, and the third one the array itself. If you want to modify the array, use these two arguments.
forEach