title: ES6 spread elements vs nested forEach performance
body: <p>I have the following function</p>
  
  <pre><code>const modules = [{courses:[...]},{courses:[...]},...]
  const deleteCourses = [];
  modules.forEach((mod) =&gt; {
      mod.courses.forEach((course) =&gt; {
          deleteCourses.push(course));
      }
      // versus
      deleteCourses = [...deleteCourses, ...mod.courses];
  });
  </code></pre>
  
  <p>Assuming modules and courses to have between 30-100 length I was wondering which one of those is more efficient?</p>
  
  <p>On the one hand I was taught to avoid nesting <code>forEach</code> loops. In the other hand array literal creates a new <code>Array</code> instance each time.</p>
  
  <p>Thanks!</p>