What is the main difference between native DOM events and custom events in JavaScript?
The key difference is that custom events can carry arbitrary data through the detail property, while native DOM events have predefined properties. Custom events (created using CustomEvent constructor) allow developers to pass custom data that's relevant to their application's needs. This makes them more flexible for application-specific event handling. Additionally, custom events are always triggered programmatically, while native events can be triggered both by user actions and programmatically.