DEV Community

Discussion on: Array.map() + async/await

Collapse
 
midblue profile image
Jasper Stephenson

I use dev.to all the time, but this is the first time I've come here from googling a bug. Thanks for posting, and it fixed my issue!

Turns out you can't just do

async () => {
  const a = array.map(async el => await foo(el))
  await Promise.all(a)
  console.log(a) // this shows all values properly, but still wrapped in Promises
}