await dalam Loop Playground

Send Mrs. Sari’s runners to the market one by one (for…of with await), all at once (Promise.all), or through a forEach: real timers show when they are all…

Why it matters

This is one of the most common causes of "why is loading so slow", and one of the easiest to fix: swapping an await in a loop for Promise.all can cut seconds to hundreds of milliseconds. But forEach with an async callback waits for nothing, and thousands of requests at once can be turned away by the server.

The key idea

await in a loop means queueing; map plus Promise.all means together

Common mistakes

Try it in this playground