When does an async task run in javascript?

Suppose a javascript task makes an asynchronous call. e.g. xhr.send (material)

  • Is (async) sending sent to another thread immediately? or
  • Is the dispatch not sent before the completion of the current task?

I'm sure this is (2) the latter, but this behavior is covered by the specification or is it just a typical implementation. In the same vein ... Is creating a listener a synchronous call? Is there a specification covering this?

+4
source share

Source: https://habr.com/ru/post/1663654/


All Articles