4 ms·
Wasn't one point also that generators and such are contagious?
by k__ 7y ago
Wasn't one point also that generators and such are contagious?
- lhorie 7y agoasync is contagious, generators are not. const foo = async () => {} const mustAlsoBeAsync = async () => console.log(await foo()) const gen = function* () { let n = 10 while (n) yield n--; } const doesntNeedToBeGenerator = () => { for (const n of gen()) console.log(n) }