Skip to content

Instantly share code, notes, and snippets.

@hotohoto
Last active January 20, 2017 16:21
Show Gist options
  • Save hotohoto/2f5746b4ade7984f832b256a900d3aa5 to your computer and use it in GitHub Desktop.
Save hotohoto/2f5746b4ade7984f832b256a900d3aa5 to your computer and use it in GitHub Desktop.
A simple async await example
const test = () => new Promise((resolve, reject) => {
setTimeout(() => {
return resolve('hi')
}, 100)
})
const doTest = async () => {
const ret = await test()
console.log(ret)
}
doTest()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment