1. The Event Loop known from materials is not a cycle, but the whole process of the cycle

2. What is EventLoop? First, it is often asked in front-end interview, so it is implemented by js???? Is implemented in C++, so why does the front-end ask? I don’t know

Look at something I heard someone say

Basic principles of operating system: In the figure:

(1) Keyboard, we click J key, the circuit of J key stores a message

(2) Then the J key should correspond to something like ASC code

(3) This information is then passed to the operating system

(4) to this event to the browser (operating system events can be plugged into USB, for example, the operating system will generate an event, but will not notify the browser, because browsers can’t handle this issue, so the operating system can accept external devices, or external network signal, and then will accept to give to other software)

(5) Then pass to the input box

So how does the operating system know that the user pressed J? It’s task polling, it accesses a queue every few milliseconds, it executes an event, it keeps polling

See below JS:

When JS encounters asynchronous tasks, such as Ajax

Then is to see the official documentation nodejs, this is a translated zhuanlan.zhihu.com/p/34924059