LLD - Behavioral Design Patterns — Part 2
What will be the output of this code snippet?
class Mediator {
notify(sender, event) {
if (event === 'start') {
console.log(sender + ' started');
} else {
console.log('Unknown event');
}
}
}
const mediator = new Mediator();
mediator.notify('ComponentX', 'stop');