Skip to content

Instantly share code, notes, and snippets.

@victorb
Last active October 30, 2020 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save victorb/9579427d3f30525d725739ee2fca5b33 to your computer and use it in GitHub Desktop.
Save victorb/9579427d3f30525d725739ee2fca5b33 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: "finish"
}
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