I am trying to call a static method from a parent static method.
Here is what I'd like to achieve:
class Parent {
static greet() {
console.log(self.message()) // <-- what should that be?
}
}
class Child1 extends Parent {
static message() {
return 'Hello, World'
}
}
class Child2 extends Parent {
static message() {
return 'Hi, Everyone'
}
}
My goal is to have Child1.greet()
log Hello, World
and Child2.greet()
log Hi, Everyone
.
What should I replace the self
keyword with in the greet()
method?