I want to change the current object in for each loop and it does not work, Why it is not working and how can i do this?
var arr = [{num: 1}, {num: 2}]; arr.
You are not working on the object so changes are not transferred.
You can do this instead:
arr.forEach(function(item, ind, array) { array[ind] = {somethingElse: 1} });