This happens because the Promise object holds its state internally .(发生这种情况是因为Promise对象在内部保持其状态。)
So when you call .then
on a Promise object it will either :(因此,当您在Promise对象上调用.then
时,它将:)
Await for resolution, and then fire the callback(等待解析,然后触发回调)
If the promise is already resolved, the callback will execute immediately(如果承诺已经解决,则回调将立即执行)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…