Is it possible to declare an anonymous generator function using the arrow syntax in ES6 JavaScript? This is what I've tried:
let func = *() => { };
but this doesn't parse (I'm using Babel.js to compile my ES6 to ES5). The documentation on MDN only mentions the more standard syntax:
let func = function *() { };
I'd like to be able to define the generator function using a arrow in order to take advantage of the lexical scoping of this
. Is this possible?