title: Why can't I get JavaScript yield to work?
body: <p>I'm trying to run the code from here</p>
  
  <p><a href="https://developer.mozilla.org/en/New_in_JavaScript_1.7#Generators_and_iterators_%28merge_into_Iterators_and_Generators%29" rel="nofollow">MDN: Generators and Iterators</a></p>
  
  <pre><code>function fib() {
    var i = 0, j = 1;
    while (true) {
      yield i;
      var t = i;
      i = j;
      j += t;
    }
  }
  
  var g = fib();
  for (var i = 0; i &lt; 10; i++) {
    console.log(g.next());
  }
  </code></pre>
  
  <p>I cannot get it working in Node.js, Chrome or Firefox</p>