console.log("1")
setTimeout(()=>{
console.log("2")
Promise.resolve().then(()=>{
console.log(11)
})
},0)
setTimeout(function (){
console.log("10")
Promise.resolve().then(()=>{
console.log(12)
})
},0)
Promise.resolve().then(()=>{
console.log(3)
setTimeout(function (){
console.log("8")
},0)
setTimeout(function (){
console.log("9")
},0)
Promise.resolve().then(()=>{
console.log(4)
})
console.log(5)
}).then(function (){
console.log(7)
})
console.log(6)
the execution result of the above code in the browser is in line with the expected 1, 6, 3, 5, 4, 7, 11, 10, 10, 12, 8, and 9.
but the result of execution in node environment is unstable and does not match the claims of macroTask and microTask. What is the cause?