title: Get sum from the nested array of objects
body: <p>I have below array of objects. As you can see, there is a nested object named <code>count</code> in each of these objects. I want to get total of <code>Closed</code>, <code>Verify</code> and <code>Analyze</code></p>
  <p>For e.g. the total of <code>Closed</code> is 23, <code>Verify</code> is 3 and <code>Analyze</code> is 20</p>
  <pre><code>&quot;byPerson&quot;: [
        {
          &quot;personId&quot;: &quot;973567318&quot;,
          &quot;firstName&quot;: &quot;Others&quot;,
          &quot;lastName&quot;: &quot;&quot;,
          &quot;count&quot;: {
            &quot;Closed&quot;: 7,
            &quot;Verify&quot;: 3,
            &quot;Analyze&quot;: 19
          }
        },
        {
          &quot;personId&quot;: &quot;1514903899&quot;,
          &quot;firstName&quot;: &quot;Yatish&quot;,
          &quot;lastName&quot;: &quot;Patel&quot;,
          &quot;count&quot;: {
            &quot;Closed&quot;: 16,
            &quot;Analyze&quot;: 1
          }
        }
   ]
  
  </code></pre>
  <p>I tried this way but it didnt work. for e.g to get total of <code>Closed</code></p>
  <pre><code>cosnt result = data.reduce((a, b) =&gt; ({&quot;Closed&quot;: a.count[&quot;Closed&quot;] + b.count[&quot;Closed&quot;]}));
  </code></pre>