QuizNot attempted
await in a loop
1–4 to choose, Enter to submit
Show answer & explanation
Correct answer:
- A runs requests one after another (total ≈ sum of times); B runs them concurrently (≈ the slowest one)
- Each
awaitinside the loop pauses before starting the next request, so A is sequential (≈ sum of times), whileids.map(fetchUser)starts every request immediately andPromise.allwaits for all (≈ the slowest). - Not identical after transpilation: the semantics differ, transpilers preserve them.
- Not 'A concurrent, B sequential': backwards.
- Not 'B keeps order but A doesn't': both preserve input order.
- Sequential is right when requests depend on each other or you must rate-limit.