title: Javascript reduce() on Object
body: <p>There is nice Array method <a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/Reduce" rel="noreferrer"><code>reduce()</code></a> to get one value from the Array. Example:</p>
  
  <pre><code>[0,1,2,3,4].reduce(function(previousValue, currentValue, index, array){
    return previousValue + currentValue;
  });
  </code></pre>
  
  <p>What is the best way to achieve the same with objects? I'd like to do this:</p>
  
  <pre><code>{ 
      a: {value:1}, 
      b: {value:2}, 
      c: {value:3} 
  }.reduce(function(previous, current, index, array){
    return previous.value + current.value;
  });
  </code></pre>
  
  <p>However, Object does not seem to have any <code>reduce()</code> method implemented.</p>