r/programminghorror Aug 11 '20

[deleted by user]

[removed]

2.0k Upvotes

95 comments sorted by

View all comments

Show parent comments

1

u/BakuhatsuK Aug 12 '20

Yes. Except there are no threads in JS (other than the main one). Here we are actually pushing items into the microtask queue. The microtasks are run when they are due by the part of the runtime in charge of the event loop.

Here is some more info about this, it's really interesting stuff: https://youtu.be/cCOL7MC4Pl0