Last active
October 26, 2016 08:45
-
-
Save Last-Order/e151f0e7d09c2fb457896a0fb44e8436 to your computer and use it in GitHub Desktop.
async_await.js
This file contains 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
function wait(delay) { | |
return new Promise((resolve, reject) => { | |
setTimeout(resolve, delay); | |
}); | |
} | |
async function hello() { | |
await wait(delay); | |
console.log('executed'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment