3
cahva
8y

Javascript .map(). I use it quite often. For example with Promise.all()

Comments
  • 0
    @eldy For example you have an array and you want to return modified array (for example do some async or ajax stuff based on the array's item).

    Promise.all(arr.map(doSomething))
    .then(result => console.log(result))
    .catch(err => handleErr(new Error(err)))
Add Comment