You can kinda define generators with an arrow function, kinda:
const foo = (function*() {
yield 1;
})();
console.log(foo.next().value);
I've only written one generator in "real life" and ended up replacing it anyway: // A generator function that returns a rotating vector
function* circlePath(stepsPerRotation = 60, theta = 0) {
while (true) {
theta += 2 * Math.PI / stepsPerRotation;
yield [Math.cos(theta), Math.sin(theta)];
}
}