Rahul Raval
Sep 4, 2018 · 1 min read

Great Article!
Just one thing, this can be also achieved by Promise.all(), right?

let promiseArr = [];
ids.forEach((id, index) => {
promiseArr.push(asyncMapFunc(id));
}
Promise.all(promiseArr)
.then((resultArr) => console.log(resultArr));
// resultArr will contain the results in order of promise inputed //in promiseArr array.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade