Given the Java code snippet above, how would you achieve the same functionality in TypeScript as ParentClass.this.a
?
class ParentClass{
a: number = 1;
class ChildrenClass{
b: number = 2;
run(){
this.b = parentInstance.a; // Assuming 'parentInstance' is an instance of the ParentClass
}
}
}
I am trying to access the parent's variable while inside a callback function.