AniUI Academy
medium+250 XPFrontend AlgoArena

Custom Event Emitter / PubSub

Event emitters power Node.js and DOM events. Implement an EventEmitter class.

What it has to do

  • .on(event, listener) registers a listener callback.
  • .emit(event, ...args) calls all registered listeners with args.
  • .off(event, listener) unregisters a specific listener.

Your workspace

Try it yourself
Loading playground...

Ready to check it?

1 tests run against your code, right here in your browser. Sign in to claim the XP when you pass.

AI Crack & Solution Assist

Stuck? Get instant AI hints or break down the optimal solution.