Promises: why is the reject executed after sync code and before async one

前端 未结 0 699
挽巷
挽巷 2020-12-11 04:16

I have the following code:

const doWorkPromise = new Promise((resolve, reject) => {
    console.log(\'#1 (sync call)\');
    setTimeout(() => {
                 


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题