I was wondering, is there a standard way for class properties and methods to refer to each other in their declaration? For example:
class A {
methodA(){
b.methodB()
...
}
}
class B {
methodB(){...}
}
const a = new A();
const b = new B();
///will throw ReferenceError: Cannot access 'b' before initialization;
I understand that you can add methodA in later after all class/object declarations, but it gets quite untidy after many repetitions, which I feel like defeats the purpose of classes. Or that you can delay the reference through some other means. Is there a standard way to do this?