title: Reduce a sequence of items provided by a generator in JavaScript
body: <p>Say I have a sequence of items and I want to perform a reduce operation via <code>myReducer</code> function (whatever it is). If my items are in an array (say <code>myArray</code>), it's easy:</p>
  
  <pre><code>myArray.reduce(myReducer);
  </code></pre>
  
  <p>What if, however, my sequence is quite large and I don't want to allocate an array of all of it, only to immediately reduce it item after item? I can create a generator function for my sequence, that part is clear. Is there a straightforward way of how to then perform the reduction? I mean apart from writing the reduce functionality for a generator myself.</p>