Javascript

Could you describe how to create an event emitter class in JavaScript, specifically focusing on the methods on, emit, and off?

Did you come across this question in an interview?

Interview question asked to Frontend Engineers interviewing at Siemens, Amazon Web Services, Peak Games and others: Could you describe how to create an event emitter class in JavaScript, specifically focusing on the methods on, emit, and off?.