Instruction: Write a simple implementation of the pub/sub pattern for event handling in JavaScript.
Context: This question tests the candidate's understanding of design patterns and their ability to implement decoupled communication between components.