3 ms·
I'm not sure I follow, JS doesn't have coroutines (generator functions can be used kind of like coroutines, but for example you can't resume them with an argume
by duped 1y ago
I'm not sure I follow, JS doesn't have coroutines (generator functions can be used kind of like coroutines, but for example you can't resume them with an argument).
- FjordWarden 1y agoYes it does: function* greeter() { const name = yield "What's your name?" yield `Hello, ${name}!` } const gen = greeter() console.log(gen.next().value) console.log(gen.next("Alice").value)
- duped 1y agoTIL!