title: How can I get the following generator to work?
body: <p>As an experiment I want to create a generator that yields some integers with the following approximate design. </p>
  
  <p>Can I get this to work (i.e. yielding from an inner function)?</p>
  
  <pre><code>function* numbers() { 
    [...Array(31)].forEach((_,i)=&gt; {
        yield i; // Invalid syntax - how can this be changed?
    });
  }
  
  var generator = numbers();
  
  for(var i of generator) {
      console.log(i); // I want 0 1 2 3 4 5 6 7... to 30 to be printed
  }
  </code></pre>