Answer the question
In order to leave comments, you need to log in
Correct reference to an object in js?
Hello. There are 2 objects and each of them must be able to access the other (methods and values) from itself.
class Object1 {
constructor() {
this.object2 = new Object2(this);
}
}
class Object2 {
constructor(object) {
this.object1 = object;
}
}
var object = new Object1();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question