function* generatorFunction() {
yield (yield 1)(yield 2)(yield 3)();
}
var iterator = generatorFunction();
var iteratedOver = [iterator.next().value, iterator.next().value, iterator.next().value];
I'm not sure how this works.
yielddoesn't return a function reference, so what are parentheses like (yield 2)doing - are they live arrow anonymous functions without bodies? What are they called using a partial application?
Something is missing for me, can someone explain?
Update. I tried three browsers, Chrome 50.0.2661.86, Safari 9.1 (50.0.2661.86), Firefox 44.0.2, all without errors.
ESFiddle also runs it without errors.
Commentary by Babel commentators also makes mistakes.
The source of the question is http://tddbin.com/#?kata=es6/language/generator/send-function , the second kata.