I'm trying to extend one class from another inside the module. The code looks like that:
let af = {
MyClass: class {
constructor() {
console.log("constructor of my class");
}
},
myNextClass: class extends this.MyClass { // *
constructor() {
console.log("constructor of the next class");
}
},
myOtherClass: class extends this.MyClass {
constructor() {
console.log("constructor of the other class");
}
},
}
in the result console throws the TypeError:
Uncaught TypeError: class heritage this.MyClass is not an object or null
referring to line *. Could you help me to fix that?