I was learning about JavaScript’s event loop on the MDN doc. It mentioned that a message in the queue is run to completion, but at the end, it said that the event loop is never blocked. I don’t really understand this. Isn’t this a contradiction? Please help me understand the difference between them. “Run-to-completion” Each message is processed completely before
Tag: event-loop
Is Observables is also executed in the same way like promises in the call stack? [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 1 year ago. Improve this question I’m a complete novice when it comes to Javascript. Please assist me in comprehending the concepts of Observables. Do Observables
when I learned about microtask and Promise , I came across a behavior I don’t understand
I didn’t return something in then() callback, In my opinion the output should be 1 5 7 2 6 3 4,but the result is 1 2 5 3 6 7 4, who can tell me why Answer Alright, this will be very verbose. Contrary to others, i’ll claim, that the execution order for the console.log calls is completely deterministic here.
javascript/browser: when does event dispatching exactly happen?
This SO question & answers and DOM level3 docs states that manual events are dispatched synchronously in browsers. My question, however, relates to user-related events (real clicks), not manually triggered ones. I created a small jsfiddle demo with a button + onclick handler, the handler does some synchronous work for 2 seconds (blocking sync wait, long enough for my eye
Difference between microtask and macrotask within an event loop context
I’ve just finished reading the Promises/A+ specification and stumbled upon the terms microtask and macrotask: see http://promisesaplus.com/#notes I’ve never heard of these terms before, and now I’m curious what the difference could be? I’ve already tried to find some information on the web, but all I’ve found is this post from the w3.org Archives (which does not explain the difference