Created
November 20, 2019 14:16
-
-
Save Hebilicious/bb93b01cd78bf6fd9bbdd30892cccb18 to your computer and use it in GitHub Desktop.
await for...of =>reduce
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
[1,2,3,4,5,6].reduce(async(previousPromise, thing) => { | |
await previousPromise | |
return asyncOperation(thing) | |
}, Promise.resolve()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment