title: Js change object inside array in for each loop
body: <p>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?</p>
  
  <pre><code>var arr = [{num: 1}, {num: 2}];
  
  arr.forEach(function(item) {
    item = {somethingElse: 1}
  });
  
  console.log(arr);
  </code></pre>