Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// 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