Skip to content

Instantly share code, notes, and snippets.

@prakashsvmx
Created May 20, 2021 09:04
Show Gist options
  • Save prakashsvmx/2f370d5d4433a6509742c1fc9a551c54 to your computer and use it in GitHub Desktop.
Save prakashsvmx/2f370d5d4433a6509742c1fc9a551c54 to your computer and use it in GitHub Desktop.
async function logInOrder(urls) {
// fetch all the URLs in parallel
const textPromises = urls.map(async url => {
const response = await fetch(url);
return response.text();
});
// log them in sequence
for (const textPromise of textPromises) {
console.log(await textPromise);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment