Promise.resolve(1).then(() => {
console.log('then1')
Promise.resolve(2).then(() => {
console.log('then3')
Promise.resolve(3).then(()=> {
console.log('then4')
Promise.resolve(4).then(() => {
console.log('then5')
Promise.resolve(5).then(()=> {
console.log('then6')
})
})
}).then(() => {
console.log('then7')
})
}).then(() => {
console.log('then8')
})
}).then(() => {
console.log('then2')
}).then(() => {
console.log('then9')
}).then(() => {
console.log('then10')
})
複製代碼
Ready GOpromise
Promise.resolve()至關與new Promise((resolve,reject)=>{resolve()})bash
第一輪函數
第二輪spa
第三輪code
第四輪string
第五輪console
第六輪class