var p2 = new Promise(resolve => {
setTimeout(() => {
resolve()
}, 2000)
})
var p1 = new Promise(resolve => {
resolve(p2)
})
p1.then(data => {
console.log("p1")
})
p2.then(data => {
console.log("p2")
console.log("p1 status ", p1) // pending
Promise.resolve().then(() => {
console.log("here") // p1.then()
})
})
excuse me, when will the state of p1 change? Why is the state of p1 pending
when console.log ("p1 status", p1)
is executed? Thank you very much ~