January 2019
Beginner
210 pages
4h 47m
English
We can use the new await…of expression to iterate and await each of the promises returned by an asynchronous iterator:
function* g1() { yield 2; yield 3; yield 4;}async function func() { for await (const x of g1()) { console.log(x); }}(async () => { await func();})();
Read now
Unlock full access