Skip to content

Instantly share code, notes, and snippets.

@batrudinych
Created January 14, 2019 10:58
Show Gist options
  • Save batrudinych/77b6f71e189cdcdc7a7823504c33a25d to your computer and use it in GitHub Desktop.
Save batrudinych/77b6f71e189cdcdc7a7823504c33a25d to your computer and use it in GitHub Desktop.
Running async operations sequentially and harvesting the results
async function take0() {
// Harvesting
const results = [];
for (const argument of listOfArguments) {
const index = await asyncOperation(argument);
results.push(index);
}
return results;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment