Skip to content

Instantly share code, notes, and snippets.

@sagardere
Last active August 22, 2018 11:23
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 sagardere/6925b4c56f5a7f5203a2b62b6060eeaa to your computer and use it in GitHub Desktop.
Save sagardere/6925b4c56f5a7f5203a2b62b6060eeaa to your computer and use it in GitHub Desktop.
var async = require('async')
async function f() {
let promise = new Promise((resolve, reject) => {
setTimeout(() => resolve("done!"), 1000)
});
let result = await promise; // wait till the promise resolves (*)
alert(result); // "done!"
}
f();
@sagardere
Copy link
Author

Simple Await demonstration program.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment