Skip to content

Instantly share code, notes, and snippets.

@Last-Order
Last active October 26, 2016 08:45
Show Gist options
  • Save Last-Order/e151f0e7d09c2fb457896a0fb44e8436 to your computer and use it in GitHub Desktop.
Save Last-Order/e151f0e7d09c2fb457896a0fb44e8436 to your computer and use it in GitHub Desktop.
async_await.js
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