80

带你了解JavaScript的运行机制—Event Loop

 5 years ago
source link: https://juejin.im/post/5c55aa2851882524c84ef517
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.
JS 是单线程的。 首先,众所周知,JS 是单线程的,为什么这种低效的运行方式依旧没有被淘汰那?这是由它的用途决定的;JS 主要用途是用户交互和DOM操作,举例来说假如js同时有两线程,一个线程在某个DOM节点上添加内容,另一个线程却删除了这个节点,这时候浏览

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK