title: How to convert nested array of objects into one array of objects using javaScript?
body: <p>I have array which contains affiliate arrays, I don't want to access children of the array by index, my aim is to merge this data and and get the following result: <code>[{id:'11223', price:92},{id:'92221', price:90}]</code>, What is the best way to achieve this? Thanks.</p>
  <p>Sum of the final reulst:
  <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>let finalResult = [{id:'11223', price:92},{id:'92221', price:90}]
  
  let sum = finalResult.reduce((acc, curr)=&gt; {
  return acc+ curr.price
  }, 0)
  console.log(sum)</code></pre>
  </div>
  </div>
  </p>
  <p>`</p>
  <p>Nested array:
  <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>let nestedArray = [
    [
     { 
      id:'11223',
      price:92
      }
    ],
    
    [
     {
      id:'92221',
      price:90
     }
    ]
  ]</code></pre>
  </div>
  </div>
  </p>