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

A custom EventEmitter registers a 'once' listener that re-emits the same event from inside itself. How many times does the handler body run?

const ee = new EventEmitter(); let calls = 0; ee.once('go', () => { calls++; ee.emit('go'); }); ee.emit('go'); console.log(calls);