class A {
constructor() {
this.test = 'test';
this.b = null;
}
}
class B {
constructor() {
}
log() {
console.log("log: ");
console.log(super.test);
}
}
var a = new A()
const C = Object.assign(a, B);
console.log(C);
C.log();
Is it possible to extend instance of a class with class definition? ... in a way that method of B use A's property! I want to add a few methods to a few of A instances.