What will the following code log?
class Animal {
makeSound() {
console.log("Generic sound");
}
}
class Dog extends Animal {
makeSound() {
console.log("Bark");
}
}
const pet = new Dog();
pet.makeSound();
Generic sound
Bark
Error
Undefined
This question is part of this quiz :
OOP in JavaScript