5 ms·
A little more verbose than your example but https://github.com/tc39/proposal-async-do-expressions https://github.com/tc39/proposal-async-do-expressions would he
by jimmydief 5y ago
A little more verbose than your example but https://github.com/tc39/proposal-async-do-expressions https://github.com/tc39/proposal-async-do-expressions would help with this.
- fregante 5y agoThanks! I think it wouldn’t await the whole loop though for (const item of iterable) async do { await item() } This would be equivalent to Promise.all(arr.map(async item => { await item() }) Notice the lack of await before Promise.all