LLD - Behavioral Design Patterns — Part 2
Given the following code snippet, what will be the output?
class Mediator {
notify(sender, event) {
if (event === 'A') return 'Handled A';
if (event === 'B') return 'Handled B';
return 'Unknown event';
}
}
const mediator = new Mediator();
console.log(mediator.notify('Component1', 'B'));