JavaScript card revieweasy
Explain event delegation in JavaScript and why we should use it.
Event delegation is a technique where instead of adding event listeners directly to multiple child elements, we attach a single event listener to their parent element. It works due to 'event bubbling' (events propagate upwards through the DOM tree). It saves memory, improves performance, and automatically handles dynamic elements added to the parent later.