Skip to content

Instantly share code, notes, and snippets.

@indongyoo
Created April 3, 2018 12:28
Show Gist options
  • Save indongyoo/700a9b5dcf47fbbbb63c27399c6bcc15 to your computer and use it in GitHub Desktop.
Save indongyoo/700a9b5dcf47fbbbb63c27399c6bcc15 to your computer and use it in GitHub Desktop.
const add2 = a => Promise.resolve(a + 2);
(function() {
const list = [1, 2, 3, 4];
const result = list.map(async function(val) {
return await add2(val);
});
console.log(result, 'async/await 1');
// [Promise, Promise, Promise, Promise] async/await 1
}) ();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment