I can call class function from initiated class, but i cant display value of class property.
class A {
constructor() {
this.myvariable = "value";
let b = new B(this.myCallback);
}
myCallback() {
console.log(`myCallback() => ${this.myvariable}`);
}
}
class B {
constructor(cb) {
cb();
}
}
var a = new A();
I need to call class A method from class B. When I do as above, console prints this.myvariable as undefined.