Last active
January 14, 2018 09:48
-
-
Save schahriar/3852536d04af5d6af0eca9624e674df0 to your computer and use it in GitHub Desktop.
For Loop basic parallel #async-await #medium
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
| 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