I have following code:
var ObjectOne = {
a : {
b : 4,
...
}
observer : 0,
...
init() {
this.a.b = 5;
...
this.observer = new IntersectionObserver(this.onIntersection, ...);
this.observer.observe(...);
...
}
onIntersection(entries, observer) {
...
var test = this.a.b;
...
}
}
And when run it, i have an error at a moment, when onIntersection() is executed. The error is: Uncaught TypeError: Cannot read property 'b' of undefined. How i can pass 'this' instance of ObjectOne to onIntersection() function?