title: Can js forEach take other inputs
body: <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>function addToArr(num, arr) {
    arr.push(num);
  }
  theArr = [1, 2, 3, 4];
  myArr = [];
  theArr.forEach(addToArr(ele, theArr));
  
  console.log(myArr);</code></pre>
  </div>
  </div>
  </p>
  
  <p>I wanted to write a function that could be used in a forEach() that could take a different array as a parameter - that I could push to.</p>