JavaScript · Senior · Question 6 of 75
What does for await...of do?
- ✓Correct answer: Iterates over an async iterable, awaiting each value
- 2Runs all loop iterations in parallel and waits for them to finish
- 3Repeats the loop until the promise becomes
fulfilled
Explanation
It works with objects that have Symbol.asyncIterator: async generators, streams (ReadableStream), API pagination. Iterations run sequentially. To process an array of promises in parallel, use Promise.all.