Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

deno
deno classes
event target
class eventtarget

What is the EventTarget class in Deno?

Educative Answers Team

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

What is Deno?

It is a small, general-purpose runtime environment for JavaScript with first-class support for various interfaces, ECMAScript modules, and seamless TypeScript integration.

Class EventTarget

Class EventTarget is a DOM interface implemented by objects that can receive events and may also have listeners for incoming objects.

Properties

[Symbol.toStringTag]: string

Methods

addEventListener

addEventListener(type: string, listener: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions): void

This method listens to a type of value (string in most cases) using the listener method. After the event is dispatched, this class calls the callback function. The options argument defines the listener options. The datatype is used in boolean. The event listener is appended to target’s event listener list and is not appended if it has the same type, callback, and capture.

dispatchEvent

dispatchEvent(event: Event): boolean

This method is used to dispatch any synthetic event to target. It returns true if its cancelable attribute value is false or if its preventDefault() method was not invoked.

removeEventListener

removeEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void

Removes the event listener from the list of the target event listener with the same type, callback, and options.

RELATED TAGS

deno
deno classes
event target
class eventtarget
Copyright ©2022 Educative, Inc. All rights reserved

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring