class WeatherBroadcastStation { constructor() { } registerObserver(weatherStation) { } removeObserver(weatherStation) { } notifyObservers(weatherData) { } } class WeatherStation { constructor(name) { this.name = name; } // Update the weather data for this WeatherStation. update(weatherData) { console.log(`Weather update for ${this.name}: ${weatherData}`); } } // Usage: // Create WeatherBroadcastStation const weatherBroadcaster = new WeatherBroadcastStation(); // Create WeatherStations (observers) const delhiStation = new WeatherStation('Delhi'); const mumbaiStation = new WeatherStation('Mumbai'); // Register WeatherStations to WeatherBroadcastStation weatherBroadcaster.registerObserver(delhiStation); weatherBroadcaster.registerObserver(mumbaiStation); // Notify Weather Stations with some weather data weatherBroadcaster.notifyObservers('Sunny with a chance of rain'); // Output: // Weather update for Delhi: Sunny with a chance of rain // Weather update for Mumbai: Sunny with a chance of rain