Remember the MessageManager from the topic? We forgot to remove the event listeners this time. Remove the given event listener so that it doesn't output more messages.
Working with events
Message manager
Report a typo
Write a program in JavaScript
// do not change the below lines
const messageManager = new MessageManager();
const messageSentListener = (message) => {
console.log(`Message sent: ${message}`);
};
messageManager.on('messageSent', messageSentListener);
messageManager.sendMessage('Hello, world!');
// write your code below
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.