title: How to grouped json and sum its score?
body: <p>How to grouped json and sum its score? i have make this approach but still stuck to addition the value.</p>
  <p>I have this json value:</p>
  <pre><code>A = [ { name: 'Boy', score: 10}, { name: 'Marry', score: 90 }, { name: 'Boy', score: 70 } ]
  </code></pre>
  <p>i want to get the result json like this</p>
  <pre><code>Result = [ { name: 'Boy', score: 80 }, { name: 'Marry', score: 90 } ]
  </code></pre>
  <p>i tried this code but still failed to add the value</p>
  <pre><code>let grouped = Object.values(data.reduce((r, {nickname, score}) =&gt; {
                  r[nickname] = r[nickname] || { nickname, score: [] };
                  r[nickname].score =  r[nickname].score + score
                  return r;
              }, {}))
  
              console.log(grouped);
  </code></pre>
  <p>the result is</p>
  <p>Result = [ { name: 'Boy', score: '1070' }, { name: 'Marry', score: '90' } ]</p>
  <p>it converted to string :(
  Please help me</p>