setImmediate(_ => {
console.log(0)
})
setTimeout(_ => {
console.log(1)
})
console.log(2)
new Promise(resolve => {
console.log(3)
resolve()
}).then(_ => {
console.log(4)
})
setImmediate(_ => {
console.log(5)
})
process.nextTick(_ => {
console.log(6)
})
console.log('end')
网友评论