title: Filter array of objects with another array of objects and get new array of objects
body: <p>I have two array of objects and I want to get a new one which is combination of those two.</p>
  <pre><code>const all_products = [ 
    {
     id : 1,
     name : &quot;Coca Cola&quot;,
     price : 12.34
    },
   {
    id : 2,
    name : &quot;Marbo Chips&quot;,
    price : 8.34
   },
   {
   id : 3,
   name : &quot;Seven Days&quot;,
   price : 4.34
   },
  {
  id : 4,
  name : &quot;Lays&quot;,
  price : 32.34
   },
  {
  id : 5,
  name : &quot;Pringles&quot;,
  price : 2.34
  }
   ];
  </code></pre>
  <p>And this one:</p>
  <pre><code>const shopping_cart = [
  {
   id : 1,
   qty : 4
  },
  {
   id : 5,
   qty : 2
  }
   ];
  </code></pre>
  <p>I want to filter through all_products array by comparing if id's are the same and want to add qty to that object and get this</p>
  <pre><code>new_arr = [
    {
    id: 1,
    name: &quot;Coca Cola&quot;,
    price: 12.34,
    qty: 4
   }, {
    id: 5,
    name: &quot;Pringles&quot;,
    price: 2.34,
    qty: 2
   }]
  </code></pre>
  <p>I've succeeded by using this</p>
  <pre><code> const test = [];
  
    for( let one_product of all_products ) {
       for( let sc_item of shopping_cart ){
          if(one_product.id === sc_item.id){
            let it = {
                   ...one_product,
                   qty : sc_item.qty
           }
           test.push(it);
         }
        }
       }
  </code></pre>
  <p>But I want to do this by using js array functions like filter,some,reduce etc.</p>