const emitter = createEmitter();
emitter.emit('test'); // no listeners β no errorEmitting with no listeners should be a no-op β not throw an error.
The emit method should handle events that have no subscribers without throwing an error.
Challenge: Implement an EventEmitter that safely emits events even when no listeners are subscribed.
Example:
const emitter = new EventEmitter()
emitter.emit('nonexistent') // Should not throw
expect((() => { try { emitter.emit('test'); return true; } catch(e) { return false; } })()).toBe(true)