Usually, I write code like this:
//definition exports.getReply = function * (msg){ //... return reply; } //usage var msg = yield getReply (\'hello\'
In Javascript, how do I write a generator function in a class?
class A { * values() { yield "a value"; yield* [1, 2, 3, 4, 5]; } }
is syntactically correct. It works. You’re welcome and now dismissed.