JS Built-ins
Eventadvanced

Event β€” stopPropagation can be called without error

πŸ“– Usage Example
const et = new EventTarget()
const e = new Event('go')
const dispatched = et.dispatchEvent(e)
dispatched  // β†’ true (not prevented)

dispatchEvent() returns false if the event was cancelled, true otherwise.

Event.stopPropagation β€” safe to call

Calling stopPropagation() does not throw, even on a standalone event that is not currently propagating.

Challenge: Call stopPropagation() on an event and verify that its type is unchanged.

πŸ’‘ Hints (1)
  • β€’ stopPropagation is a no-op when called outside of an active dispatch cycle