SOURCE

setTimeout(function () {
    console.log(0);
    new Promise(function (resolve) {
        resolve();
    }).then(function () {
        new Promise(function (resolve) {
            resolve();
        }).then(function () {
            console.log(1);
        });
        console.log(2);
    });
});

new Promise(function (resolve) {
    console.log(3);
    resolve();
    console.log(4);
}).then(function () {
    console.log(5);
});

setTimeout(function () {
    console.log(6);
});

console.log(7);

queueMicrotask(() => {
    console.log(8)
});

new Promise(function (resolve) {
    resolve();
}).then(function () {
    console.log(9);
});
console 命令行工具 X clear

                    
>
console