Created
April 12, 2018 10:14
-
-
Save ramadimasatria/09ad981ff401583e7cf506175060ae7e to your computer and use it in GitHub Desktop.
Sequential Promise using Async-Await
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
const arr = [1, 2, 3, 4, 5] | |
async function sequential() { | |
for(let i=0;i<arr.length;i++) { | |
await new Promise(resolve => resolve(arr[i])) | |
} | |
} | |
sequential() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment