title: Find the sum of ages in JSON array
body: <pre><code>  var people = [
    {
      name: 'shihan', //persons name, favorite color, and age
      color: 'blue',
      age: 22
    },
    {
      name: 'john',
      color: 'blue',
      age: 21
    },
    {
      name: 'pete',
      color: 'blue',
      age: 26
    }
  ] //json api
  var newPerson = people.filter(function(x){ return x.color === 'blue'})
  newPerson.map(x =&gt; x.name)
  newPerson.reduce((a,b) =&gt; a.age + b.age)
  NaN //output
  </code></pre>
  
  <p>I need to take the age of each person and find the sum, please help! I created an API and I'm using the reduce method to find the age in the people array.</p>