In my Webapp I need to implement an API, which does not contain any ES6 class definitions, but I would like to extend of one of these classes and override some methods. Overriding does not work properly...
function A() {
this.msg = function() {
console.log("A");
}
}
class B {
constructor() {
A.call(this);
}
msg() {
console.log("B");
}
}
new B().msg();
I expect "B" as result but the method of "class" A gets executed.