What will happen in the following code?
class Animal {
speak() {
return 'Animal speaking';
}
}
class Cat extends Animal {
speak() {
return 'Meow';
}
}
const cat = new Cat();
console.log(cat.speak());
What will happen in the following code?
class Animal {
speak() {
return 'Animal speaking';
}
}
class Cat extends Animal {
speak() {
return 'Meow';
}
}
const cat = new Cat();
console.log(cat.speak());