Question 98 of 10098%
98
What does this log?
class Animal {
static create(name) {
return new this(name);
}
constructor(name) {
this.name = name;
}
speak() {
return `${this.name} makes a sound`;
}
}
class Dog extends Animal {
speak() {
return `${this.name} barks`;
}
}
const d = Dog.create('Rex');
console.log(d.speak());
console.log(d instanceof Dog);
98/100