Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumNodeJScustom EventEmitter classesSingle-choice MCQ

In a custom emitter you register a one-time listener with `once`, and the listener synchronously re-emits the same event. How many times does the listener run?

class Bus extends EventEmitter {} const bus = new Bus(); let count = 0; bus.once('tick', function handler() { count++; if (count < 3) bus.emit('tick'); }); bus.emit('tick'); // count === ?