51

从event loop到async await来了解事件循环机制

 4 years ago
source link: https://juejin.im/post/5c148ec8e51d4576e83fd836
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是用来在浏览器验证表单操控DOM元素的是一门脚本语言,如果js是多线程的那么两个线程同时对一个DOM元素进行了相互冲突的操作,那么浏览器的解析器是无法执行的。 JS为什么需要异步? 如果JS中不存在异步,只能自上而下执行,如

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK