Facebook Pixel

What is event delegation in the DOM?

Using one listener on a parent to handle events from many children, through event bubbling and the event target. It is efficient for large or dynamic lists, since you do not attach a listener to every child, and it is a common DOM interview topic.

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

Want to upskill yourself?

Our courses are taking a Coffee break, but your curiosity shouldn't. Stay engaged with namastedev linkedin, youtube, discord and other resources while you wait.

0
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.