Skip to content

Instantly share code, notes, and snippets.

@wholypantalones
Created October 11, 2018 17:54
Show Gist options
  • Save wholypantalones/bff766156362b1722bc6ff5a7dd9eb2c to your computer and use it in GitHub Desktop.
Save wholypantalones/bff766156362b1722bc6ff5a7dd9eb2c to your computer and use it in GitHub Desktop.
JavaScript Async Map
const arr = [ { key: 1 }, { key: 2 }, { key: 3 } ]
const results = arr.map(async (obj) => { return obj.key; });
Promise.all(results).then((completed) => console.log('done', arr);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment