What is the difference between event bubbling and capturing?
Bubbling fires events from the target up to the root. Capturing is the opposite, from root down to target. You can listen in either phase. Bubbling is the default and is what event delegation uses to handle child events on a parent.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in Async JavaScript and DOM Interview Questions With Answers
Promise.all rejects if any promise rejects, so all must succeed. Promise.allSettled waits for all and gives each result with a status, never rejecting. Use all when all must succeed, allSettled when you want all results regardless.
Syntax for promises that lets you write async code that looks synchronous. await pauses the function until the promise settles, and async marks a function as returning a promise. It is still promises under the hood, just cleaner syntax.
The call stack runs sync code. Async callbacks go to the microtask queue (promises) or the macrotask queue (setTimeout, events). When the stack is clear, the event loop processes all microtasks, then one macrotask, and repeats.
Still have questions?
Browse all our FAQs or reach out to our support team
