34

微任务、宏任务与Event-Loop

 5 years ago
source link: https://juejin.im/post/5b73d7a6518825610072b42b
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
首先,JavaScript是一个单线程的脚本语言。 所以就是说在一行代码执行的过程中,必然不会存在同时执行的另一行代码,就像使用alert()以后进行疯狂console.log,如果没有关闭弹框,控制台是不会显示出一条log信息的。 亦或者有些代码执行了大量计

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK