The more I learn about JavaScript and its Concurrency Model, the more confused I am... Recent source of confusion was Is JavaScript guaranteed to be single-threaded? + great course on PS: https://app.pluralsight.com/library/courses/asynchronous-javascript-reasoning .
After reading/watching a question popped up to my head with respect to UI Interaction as source of events: we know that UI is blocked if any code is executing. So the only moment when event can be triggered (e.g. when you can actually click a button and cause a click event) is when JavaScript engine is not busy (nothing on the call stack and nothing in the queue) - otherwise UI is freezed. So given queue is empty, does click event (or any UI events) end up in the queue anyway? Or are they processed instantaneously (i.e. calling event listeners synchronously)?