const p = new Promise((resolve, reject) => {
setTimeout(() => resolve(42), 100)
})
p.then(v => console.log(v)) // β 42The Promise constructor takes an executor function with resolve and reject callbacks to create a new promise.
new Promise(() => {}) creates a pending Promise. It's still a Promise instance.
Challenge: Verify a pending Promise is still instanceof Promise.