title: Get all elements from all subarrays present in an array without removing element from the principal array?
body: <p>I work on a project with a lot of arrays and in some case I have this:</p>
  
  <pre><code>let main_array = [a,b,c,d,[e,f,g],h,i,j,[k,l,m,o],[p],q,[]]
  </code></pre>
  
  <p>In my main array I have a lot of subarrays, and I want to get all element from them without removing the other elements from the main array. So I want a function which can do this:</p>
  
  <pre><code>f(main_array) --&gt; [a,b,c,d,e,f,g,h,i,j,k,l,m,o,p,q]
  </code></pre>
  
  <p>The particularity with the main array is about the number of arrays inside it, in fact, it could have 0 to n subarray(s) with 0 to n element(s).</p>
  
  <p>Is there an existing built-in function or just a simple function with filter for example that can solve this problem in a few line of code (just 1 could be great !) ?</p>
  
  <p>PS: I use node.js</p>