How can I reference constants within an inherited class so that -
They use the "local" constant if one is defined within the current class
They fallback on to the parent's constant definition
As an example, I'm wondering what I would fill each instance of ????
with below to achieve the expected printed result
class Parent {
static MY_CONST = 'aaa';
print() {
/* Expected result: Prints `aaa` */
console.log('????');
}
}
class ChildOne extends Parent {
static MY_CONST = 'bbb';
print() {
/* Expected result: Prints `bbb` */
console.log('????');
}
}
class ChildTwo extends Parent {
print() {
/* Expected result: Prints `aaa` */
console.log('????');
}
}