1Promise.resolve().then(() => { 2 console.log('promise1'); 3 const timer2 = setTimeout(() => { 4 console.log('timer2') 5 }, 0) 6}); 7const timer1 = setTimeout(() => { 8 console.log('timer1') 9 Promise.resolve().then(() => { 10 console.log('promise2') 11 }) 12}, 0) 13console.log('start'); 14
参考答案:
'start'
'promise1'
'timer1'
'promise2'
'timer2'
最近更新时间:2024-07-20