4 ms·
Oh. This is interesting. Is the `for await` loop synchronous, or is more like looping through the results of `Promise.all`? With Promise.all, you can make mult
by theprotocol 9y ago
Oh. This is interesting. Is the `for await` loop synchronous, or is more like looping through the results of `Promise.all`? With Promise.all, you can make multiple async concurrently and then await the results once all of them are complete.
- brn27 9y agofor-await loop behavior is bit complex, but roughly, it's like async await functionality. So, for-await loop wait promise step by step, and if await keyword exists in loop body, wait too. So it's looks like synchronous from inside of async function, but behave as asynchronous promise at outside of async function.