I'm getting "done..." before the timeout expired:
Promise.resolve(setTimeout(() => {
console.log('print after 3 seconds')
}, 3000))
.then(console.log("done..."))
// Result:
// done...
// print after 3 seconds.
In this other example, it seems correct, so what is the difference? Or it is just a coincidence?
Promise
.resolve(console.log("print first"))
.then(() => {
console.log("print second")
})
// Result:
// print first
// print second
Any thoughts?