# How would you run this async loop in sequence?

**URL:** <https://forum.kirupa.com/t/how-would-you-run-this-async-loop-in-sequence/679883>\
**Category:** web dev\
**Created:** [April 2, 2026, 6:00pm UTC](https://forum.kirupa.com/t/how-would-you-run-this-async-loop-in-sequence/679883 "2026-04-02T18:00:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MechaPrime](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/mechaprime/32/31154_2.png) [@MechaPrime](https://forum.kirupa.com/u/MechaPrime)\
**Post date:** [April 2, 2026, 6:00pm UTC](https://forum.kirupa.com/t/how-would-you-run-this-async-loop-in-sequence/679883/1 "2026-04-02T18:00:08Z")

</div>

Consider this snippet.

```javascript
ids.forEach(async (id) => {
  await fetchUser(id);
});
console.log('done');

```

Why is this not sequential, and what simple loop should replace it.

MechaPrime 😄

---

<div class="post-metadata">

**Author:** ![Ellen1979](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ellen1979/32/31260_2.png) [@Ellen1979](https://forum.kirupa.com/u/Ellen1979)\
**Post date:** [April 2, 2026, 6:07pm UTC](https://forum.kirupa.com/t/how-would-you-run-this-async-loop-in-sequence/679883/2 "2026-04-02T18:07:06Z")

</div>

`forEach` doesn’t wait for async callbacks, so `done` logs right away and the fetches all start together.

Ellen 😊
