Created
April 3, 2018 12:28
-
-
Save indongyoo/700a9b5dcf47fbbbb63c27399c6bcc15 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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