Implement an EventEmitter class with three methods:
on(event, handler) — subscribe.off(event, handler) — unsubscribe a previously-registered handler.emit(event, ...args) — invoke every handler registered for event,passing the extra arguments through, in registration order.
Edge cases
off for a handler that isn't registered must be a no-op.emit —the in-flight emit must still complete its current iteration safely.
The harness's solve(operations) drives your implementation through a
sequence of ['on'|'off'|'emit', ...] tuples and records the order in which
handlers fire.
Sample tests