setTimeout(() => {
console.log(1)
Promise.resolve(3).then(data => console.log(data));
}, 0)
setTimeout(() => {
console.log(2)
}, 0)
We know that the callback of setTimeout is performed in the timer phase, and
then both setTimeout are registered to the timer phase
when eventloop checks timer, two setTimeout are then executed,
and promise.resolve () in the first setTimeout is registered with microTask,
executes microTask. at the end of the timer phase
but this code executes
with results of 1 2 3 and 1 3 2
so I don"t understand why there are these two different results.