Box interview question

Implementing a simple event emitter in pure JS