Skip to content

Instantly share code, notes, and snippets.

@schahriar
Last active January 14, 2018 09:48
Show Gist options
  • Select an option

  • Save schahriar/3852536d04af5d6af0eca9624e674df0 to your computer and use it in GitHub Desktop.

Select an option

Save schahriar/3852536d04af5d6af0eca9624e674df0 to your computer and use it in GitHub Desktop.
For Loop basic parallel #async-await #medium
async (items) => {
let promises = [];
for (let i = 0; i < items.length; i++) {
promises.push(db.get(items[i]));
}
const results = await Promise.all(promises);
console.log(results);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment