Skip to content

Instantly share code, notes, and snippets.

@claustres
Last active February 20, 2018 06:40
Show Gist options
  • Save claustres/d25ab6da5d5f7056717d1d69810dc42f to your computer and use it in GitHub Desktop.
Save claustres/d25ab6da5d5f7056717d1d69810dc42f to your computer and use it in GitHub Desktop.
Async/Await run 2
async function run() {
let prefix = '(2)'
console.log(prefix + ' with await')
await asyncWithAwait(prefix)
console.log(prefix + ' with promise')
asyncWithPromise(prefix).then(_ => console.log(prefix + ' after all'))
}
run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment