title: Merging multiple arrays inside a array of objects into a single array
body: <p>I have a object where data is an array of objects, inside data object I have one users property which is an array.</p>
  
  <p>I need to get all the users into a single array. I have written using <code>map</code> and <code>concat</code>. </p>
  
  <p>Is there any way I can have a better solution, or this is correct?</p>
  
  <p>See the below snippet.</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 response = {data: [{users: [1,2,3]}, {users: [4,5,6]}]}
  
  var users = response.data.map(o =&gt; o.users)
  
  const usersCollection = [].concat(...users)
  
  console.log(usersCollection)</code></pre>
  </div>
  </div>
  </p>