I'm encountering an issue where I am unable to figure out how to extend from the third class. So, I really need guidance on how to call the A class with the parameter 'TYPE', extend it with C, and then be able to call getType() with class C. Any suggestions or solutions?
const TYPE = 'TYPE'
class A {
constructor(type) {
this.type = type;
}
getType() {
return this.type;
}
}
class B {
constructor(id) {
this.id = id;
}
getId() {
return this.id;
}
}
class C extends B {
constructor(id) {
super(id);
//Here should be a function that should bind the method from class A
}
}
const c = new C(1);
console.log(c.getId())
console.log(c.getType())