SOURCE

//[]代表监测轮次

console.log(`1 [0]`)

setTimeout(()=>{
    console.log(`3 [0]`)
    new Promise(resolve=>{
        console.log(`3.1 [0]`)
        resolve()
    }).then(()=>{
        console.log(`3.2 [0]`)
    })
    setTimeout(()=>{
        console.log(`3.3 [1]`)
        new Promise(resolve=>{
            console.log(`3.4 [1]`)
            resolve()
        }).then(()=>{
            console.log(`3.5 [1]`)
        })
        setTimeout(()=>{
            console.log(`3.6 [2]`)
        })
    })
})
setTimeout(()=>{
    console.log(`4 [0]`)
    new Promise(resolve=>{
        console.log(`4.1 [0]`)
        resolve()
    }).then(()=>{
        console.log(`4.2 [0]`)
    })
    setTimeout(()=>{
        console.log(`4.3 [1]`)
        new Promise(resolve=>{
            console.log(`4.4 [1]`)
            resolve()
        }).then(()=>{
            console.log(`4.5 [1]`)
        })
        setTimeout(()=>{
            console.log(`4.6 [2]`)
        })
    })
})
console.log(`2 [0]`)
console 命令行工具 X clear

                    
>
console