Challenge 2 — Solution Task: Define a class Dog that extends Animal from Challenge 1, overriding speak() to log "{name} barks." instead, while still calling the parent's speak() first using super.speak(). Create a Dog instance and call speak() on it. class Animal { constructor(name) { this.name = name; } speak() { console.log(`${this.name} makes a sound.`); } } class Dog extends Animal { speak() { super.speak(); console.log(`${this.name} barks.`); } } const rex = new Dog("Rex"); rex.speak(); Expected output: Rex makes a sound. Rex barks. Notes: - Dog has no constructor of its own here, so Animal's constructor runs automatically when "new Dog("Rex")" is called — there was no need to write a constructor just to pass name through unchanged. - super.speak() explicitly calls Animal's original speak() method, which is why "makes a sound" still prints even though Dog's own speak() has completely overridden the method for Dog instances. - this.name works correctly inside Dog's speak() because Animal's constructor already set it, even though Dog itself never mentions name directly.