pwindy  
在完成任务的同时,还需要不断“复盘”,不论你多么的忙,都需要留下时间思考,可以思考哪些地方做的好,哪些地方我们可以改进,应该如何改进,注重总结才是王道
console.log("script start");

setTimeout(()=>{
    console.log("setTimeout");
}, 1000)

Promise.resolve()
.then(
    function(){
        console.log("promise1");
    }
).then(
    function(){
        console.log("promise2");
    }
)

async function errorFunc(){
    try{
        await Promise.reject("error!!!")
    }catch(e){
        console.log("error caught")
    }
    console.log("errorFunc")
    return Promise.resolve("errorFunc success")
}
errorFunc().then((res)=>{
    console.log("errorFunc then res")
})

console.log("script end");

打印台的结果:

 

posted on 2022-08-10 14:56  pwindy  阅读(35)  评论(0)    收藏  举报