亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

javascript - promise scheduling issues
阿神
阿神 2017-07-05 10:54:30
0
1
1101
var p3 = new Promise( (resolve, reject) => {
    resolve('B')
})
var p1 = new Promise( (resolve, reject) => {
    resolve(p3)
})
p2 = new Promise( (resolve, reject) => {
    resolve('A')
})
p1.then(v => console.log(v))
p2.then(v => console.log(v))

node is inconsistent with the browser operation. It is normal to understand that p1 resolves a promise internally and is not synchronous, so it is obviously later than p2.

阿神
阿神

閉關(guān)修行中......

reply all(1)
阿神

Whether it is outputting A B or B A, it is correct. This is asynchronous. None of our operations can depend on the return order of previous operations.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template