How do event handlers in JavaScript get processed by the event loop?

前端 未结 3 1513
心在旅途
心在旅途 2021-01-01 07:44

I\'m a little bit confused about how browsers handle JavaScript events.

Let\'s say I have two event handlers attached to buttons A and B. Both event handlers take ex

3条回答
  •  天涯浪人
    2021-01-01 08:01

    Well the commands are indeed in a FIFO when executed by javascript. However, the handlers may take different amounts of time to send you the result. In this case the response from handler B may come back earlier and response from handler A may come later.

提交回复
热议问题