Is it possible to walk up the hierarchy tree multiple steps? For example:
class First {
constructor(word) {this.word = word};
print() {
console.log('1', this.word);
}
}
class Second extends First {
constructor(word) {super(word);}
print() {
super.print();
console.log('2', this.word);
}
}
class Third extends Second {
constructor(word) {super(word);}
print() {
// super.super.print();
super.print(); // this works to get to the top, but possible to get to the top directly?
console.log('3', this.word);
}
}
let t = new Third('Hello');
t.print();
In other words, what I'd like is it to do:
super.super.print();
// 1. hello
super.print();
// 1. hello
// 2. hello
console.log('3', this.word);
// 3. hello