Hint
Subclass instances are instanceof both the subclass and all parent classes.
class Animal {
speak() { return 'generic'; }
}
class Dog extends Animal {
speak() { return 'woof'; }
}
const d = new Dog();
console.log(d.speak());
console.log(d instanceof Dog);
console.log(d instanceof Animal);woof true true
Explanation: Dog.speak() overrides Animal.speak(). d is instanceof both since Dog extends Animal.
Key Insight: Subclass instances are instanceof both the subclass and all parent classes.