问答题969/1524【Promise第九题】下面两段代码分别输出什么?

代码一:

1setTimeout(() => { 2 console.log('timer1'); 3 setTimeout(() => { 4 console.log('timer3') 5 }, 0) 6}, 0) 7setTimeout(() => { 8 console.log('timer2') 9}, 0) 10console.log('start')

代码二:

1setTimeout(() => { 2 console.log('timer1'); 3 Promise.resolve().then(() => { 4 console.log('promise') 5 }) 6}, 0) 7setTimeout(() => { 8 console.log('timer2') 9}, 0) 10console.log('start')
难度:
2022-01-09 创建

赞赏支持

预览

题库维护不易,您的支持就是我们最大的动力!