SOURCE

console.log("script开始");
let resolve = function(){
    console.log("resolve");
}
let promise1 = new Promise(function(resolve){
    console.log("promise1");
    // (function resolve(){
    //     console.log("resolve");    
    // })();
    resolve();
    console.log("promise1结束");
}).then(function(){
    console.log("promise2");
})
setTimeout(function(){
    console.log("settimeout");
})
console.log("script结束")
console 命令行工具 X clear

                    
>
console