Skip to content

Instantly share code, notes, and snippets.

@kaidiren
Created June 7, 2017 02:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaidiren/3658137bec19cfeeb15beabbb76447e3 to your computer and use it in GitHub Desktop.
Save kaidiren/3658137bec19cfeeb15beabbb76447e3 to your computer and use it in GitHub Desktop.
#es#
const urls = [1, 2, 3];
async function download(urls) {
return urls.map(async (url) => {
const content = await Promise.resolve(url);
console.log(content);
return content;
});
}
(async () => {
await download(urls);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment