-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
DuplicateAn existing issue was already createdAn existing issue was already created
Description
class Animal {
static say() {
console.log('Animal')
}
constructor() {
this.constructor.say()
}
}
class Cat extends Animal {
static say() {
console.log('Cat')
}
}Expected Behavior:
new Animal() // console log "Animal"
new Cat() // console log "Cat"If I use the class name to access static methods, then inheritance naturally also does not work, and Cat.say() does not calls with new Cat(), cuz new Cat() calls Animal.say()
class Animal {
static say() {
console.log('Animal')
}
constructor() {
Animal.say()
}
}Metadata
Metadata
Assignees
Labels
DuplicateAn existing issue was already createdAn existing issue was already created
