
When an event fires, JavaScript automatically passes an event object to your handler function. It contains useful information: event.target is the element that was clicked, event.key is the key that was pressed, event.preventDefault() stops the browser's default behavior (like form submission or link navigation).
Reference:
TaskLoco™ — The Sticky Note GOAT