Skip to content

Instantly share code, notes, and snippets.

@trungpv1601
Created May 7, 2018 07:45
Show Gist options
  • Save trungpv1601/33882ffdb5d570bf4b5fef75a5ee09fa to your computer and use it in GitHub Desktop.
Save trungpv1601/33882ffdb5d570bf4b5fef75a5ee09fa to your computer and use it in GitHub Desktop.
Async Map in Javascript
const arr = [ { key: 1 }, { key: 2 }, { key: 3 } ]
const result = arr.map(async (obj) => { return obj.key; });
console.log(`Result: ${result}`);
// outputs "Result: ???"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment