Skip to content

Instantly share code, notes, and snippets.

@mishelashala
Last active July 22, 2020 13:27
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 mishelashala/5083eec42bdf71b133f7e5c19bc1cdbe to your computer and use it in GitHub Desktop.
Save mishelashala/5083eec42bdf71b133f7e5c19bc1cdbe to your computer and use it in GitHub Desktop.
// Promise<number>
var promisedNumber = new Promise(function asyncUnitOfWork(fulfill, reject) {
setTimeout(function () {
fulfill(10)
}, 1000)
});
console.log('start')
console.log('value: ', promisedNumber) // Promise {<pending>}
console.log('finish')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment