title: How to use forEach to alter an array
body: <p>What code is required to instruct <code>forEach()</code> to make a permanent change to an array?</p>
  
  <p>For example in the following simple code I add the phrase, "this is my " to each item in the array. According to the console log the changes were made.  But when I run the console again on the main timeline the changes weren't permanently saved to the array.  I'm sure I'm missing something simple but I can't see it.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var myArray = [];
  
  myArray.push("dog");
  myArray.push("cat");
  myArray.push("mouse");
  
  console.log(myArray);
  
  myArray.forEach(myFunction);
  
  function myFunction(item) {
      item = "this is my " +item;
      console.log(item);
  }
  
  console.log(myArray);</code></pre>
  </div>
  </div>
  </p>