Question · JavaScript and TypeScript course · Module 8: Events and the DOM

The once Method in Event Bus

What does the once() method do in an Event Bus implementation?

Answer options

  • Registers a listener that will be called only once, then automatically removed
  • Emits an event exactly once
  • Checks whether a given event has already been emitted
  • Creates a one-time copy of the Event Bus

You can check the correct answer by solving this task in the CodeWorlds game.