Skip to content

Instantly share code, notes, and snippets.

@ramadimasatria
Created April 12, 2018 10:14
Show Gist options
  • Save ramadimasatria/09ad981ff401583e7cf506175060ae7e to your computer and use it in GitHub Desktop.
Save ramadimasatria/09ad981ff401583e7cf506175060ae7e to your computer and use it in GitHub Desktop.
Sequential Promise using Async-Await
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