Skip to content

Instantly share code, notes, and snippets.

@matt-mcalister
Created January 18, 2018 15:04
Show Gist options
  • Save matt-mcalister/3f060bf32d292cfebc9448e210e043e2 to your computer and use it in GitHub Desktop.
Save matt-mcalister/3f060bf32d292cfebc9448e210e043e2 to your computer and use it in GitHub Desktop.
function resolveLater() {
return new Promise(resolve => {
setTimeout(() => {
resolve('finish');
}, 2000);
});
}
async function asyncCall() {
console.log('let');
var result = await resolveLater();
console.log(result);
// expected output: "resolved"
}
console.log("I'ma")
asyncCall();
console.log("you")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment