How can I call same-level method in base class?
If you want to call a method of a specific class instead of looking it up on the instance (on this
) or your own prototype (trough super
), reference that method directly and .call
it on the instance:
class Parent {
async A(part, id) {
}
async B(part, id) {
await Parent.prototype.A.call(this, part, id)
}
}