SOURCE

async function asyn1(){
    console.log('async1 start');
    await async2()
    console.log('async1 end')
}
async function async2(){
    console.log('async2')
}
console.log('script start')

setTimeout(function(){
    console.log('setTimeout0');
},0)
setTimeout(function(){
    console.log('setTimeout3');
},3)
// setImmediate(() => console.log('setImmediate'))
// process.nextTick(() => console.log('nextTick'))
asyn1();
new Promise((resolve) => {
    console.log('promise1');
    resolve();
    console.log('promise2');
}).then(function(){
    console.log('promise3');
})

console.log('script end');
console 命令行工具 X clear

                    
>
console