title: Sum values of objects which are inside an array with underscore.js and reduce
body: <p>I'm trying to sum values of objects inside and array with underscore.js and its reduce method. But it looks like I'm doing something wrong. Where's my problem?</p>
  
  <pre><code>let list = [{ title: 'one', time: 75 },
          { title: 'two', time: 200 },
          { title: 'three', time: 500 }]
  
  let sum = _.reduce(list, (f, s) =&gt; {
      console.log(f.time); // this logs 75
      f.time + s.time
  })
  
  console.log(sum); // Cannot read property 'time' of undefined
  </code></pre>