The this
keyword on static methods refers the class instance (the constructor). This can be confusing.
class A {
static foo() {
doSomething()
}
static bar() {
this.foo() //ERROR: Unexpected 'this'.
}
}
class B extends A {
static foo() {
super.foo() //ERROR: Unexpected 'super'.
}
}
class A {
static foo() {
doSomething()
}
static bar() {
A.foo()
}
}
class B extends A {
static foo() {
A.foo()
}
}
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too