---
title: "Comment by Alex Kit on \"6 Common mistakes in using JavaScript Promises\" | Hashnode"
description: "For such things like loops, filters, groups I use alot library - it designed for lazy iterations over arrays, but also supports Promise handlers. The first exam"
url: "https://hashnode.com/posts/common-mistakes-in-using-javascript-promises/61486c2e699fe76cd3484580/comment/61c4a3ea1b569f3d7b388852"
---

[Discussion](https://hashnode.com/posts/common-mistakes-in-using-javascript-promises/61486c2e699fe76cd3484580)

Comment [6 Common mistakes in using JavaScript Promises](https://hashnode.com/posts/common-mistakes-in-using-javascript-promises/61486c2e699fe76cd3484580)

[Alex Kit](https://hashnode.com/@tenbits)

[Dec 23, 2021](https://hashnode.com/posts/common-mistakes-in-using-javascript-promises/61486c2e699fe76cd3484580/comment/61c4a3ea1b569f3d7b388852)

For such things like loops, filters, groups I use [alot](https://github.com/atmajs/alot) library - it designed for lazy iterations over arrays, but also supports `Promise` handlers. The first example would look like this:

```
const names = ['saviomartin', 'victoria-lo'];
const users = await alot(names)
    .mapAsync(async name => {
        let { data: user } = await axios.get(`api.github.com/users${name}`);
        return user;
    })
    .toArrayAsync({ threads: 4 })
```

[Tapas Adhikary](https://hashnode.com/@atapas)

[Dec 23, 2021](https://hashnode.com/posts/common-mistakes-in-using-javascript-promises/61486c2e699fe76cd3484580/comment/61c4a3ea1b569f3d7b388852#reply-61c4a5a10e66663d56fcc00a)

[Alex Kit](https://hashnode.com/@tenbits), Great, thanks for letting me know. Shall explore it.
