The Event Object
Read event details like target and type.
The Event Argument
When an event fires, the browser passes an event object to your handler. It carries details about what happened and which elements are involved.
btn.addEventListener("click", (event) => {
console.log(event.type); // "click"
});event.type
event.type is the name of the event, letting one handler react differently to different event types.
function handle(e) {
console.log("Got a " + e.type + " event");
}