async map js

JavaScript
const list = [1, 2, 3, 4, 5] //...an array filled with values

const functionWithPromise = item => { //a function that returns a promise
  return Promise.resolve('ok')
}

const anAsyncFunction = async item => {
  return functionWithPromise(item)
}

const getData = async () => {
  return Promise.all(list.map(item => anAsyncFunction(item)))
}

getData().then(data => {
  console.log(data)
})Arr = await Promise.all(arr)let obj = {
  one: 1,
  two: 2,
  three: 3
}

obj.map((element, index) => {
  // do something
  // return result
});

/*
  map() is a higher order function (a function that takes another
  function as a parameter) and as such is synchronous
*/
Source

Also in JavaScript: