- Learning TypeScript 2.x
- Remo H. Jansen
- 38字
- 2025-04-04 17:02:05
Asynchronous iteration (for await...of)
We can use the new for...await...of expression to iterate and await each of the promises returned by an asynchronous iterator:
async function func() { for await (const x of g1()) { console.log(x); } }