ES6 Generators


From Hanging Up On Callbacks (video here).

What does the following code output?

function* powGenerator() {
  var result = Math.pow(yield "a", yield "b");
  return result;
}

var g = powGenerator();
log(g.next().value);
log(g.next(10).value);
log(g.next(2).value);

Hover below for the answer!