JavaScript的宏任务与微任务(事件循环机制,执行队列)
看下面代码,试着看一下输出什么?console.log('1')setTimeout(() => { console.log('2')})new Promise((resolve, rejects) => { console.log('3') resolve()}).then(() => { let i = 0 while(i < 1000000000) { i++ } console.log('4')})let i = 0.
原创
2020-08-23 10:34:31 ·
6490 阅读 ·
2 评论