JS Built-ins
Eventbeginner

Event Constructor β€” instanceof Event

πŸ“– Usage Example
const e = new Event('myEvent', { bubbles: true })
e.bubbles  // β†’ true

Pass an options object to configure whether the event bubbles and is cancelable.

Event β€” instanceof

Objects created with new Event() are instances of the Event class.

Challenge: Verify that new Event('x') instanceof Event is truthy.

πŸ’‘ Hints (1)
  • β€’ Event is a global constructor available in both browser and Node.js (v18+)