Implement an event emitter
Implement an event emitter class: on(event, handler), off(event, handler), once(event, handler) and emit(event, ...args). Handlers run in the order they were added. Handle a handler that removes itself or adds another handler during emit, and return a way to unsubscribe from on.
No answer yet. Write the first one; the best answer gets endorsed.
