const et = new EventTarget()
const result = et.dispatchEvent(new Event('x', { cancelable: true }))
result // β true (not cancelled)dispatchEvent() returns true if the event was not cancelled.
Listeners receive the dispatched Event object as their first argument. You can read properties like type from it.
Challenge: Verify that a listener receives an event with the correct type.