title: How to sum multiplication values from objects in an array?
body: <p>if i have an array that looks like this :</p>
  <pre><code>    &quot;orderItems&quot;: [
    {
      &quot;description&quot;: &quot;Test&quot;,
      &quot;identifier&quot;: &quot;Test identifier&quot;,
      &quot;priceCent&quot;: 1,
      &quot;lengthIn&quot;: 10,
      &quot;widthIn&quot;: 5,
      &quot;heightIn&quot;: 10,
      &quot;weightLbs&quot;: 3,
      &quot;quantity&quot;: 2
    },
  {
      &quot;description&quot;: &quot;Test-2&quot;,
      &quot;identifier&quot;: &quot;Test identifier&quot;,
      &quot;priceCent&quot;: 1,
      &quot;lengthIn&quot;: 10,
      &quot;widthIn&quot;: 5,
      &quot;heightIn&quot;: 10,
      &quot;weightLbs&quot;: 4,
      &quot;quantity&quot;: 3
    }
  ]
  </code></pre>
  <p>How can I multiply weightLbs and quantity and sum those within the objects?
  For example:</p>
  <p>3 * 2 = 6
  4 * 3 = 12</p>
  <p>and result total I want is = 18</p>
  <p>This is what I have so far, but this only adds weightLbs</p>
  <pre><code>        return delivery.order.orderItems.reduce((prev, curr) =&gt; {
        return prev + (curr.totalWeightLbs || 0);
      }, 0);
  </code></pre>