javascript - Async/Await inside Array#map() - Stack Overflow
stackoverflow.com
const promises = myArray.map(async (myValue) => {
return {
id: "my_id",
myValue: await service.getByValue(myValue)
}
});
return Promise.all(promises);
#dev #tidbits #javascript #asynchronous #pub
Collect and share the web
Get started for free