class Myclass{
private _myvar = "foo"
function1(){
this.function2(this.function3)
}
function2(myfunction){
myfunction()
}
function3(){
this.function4()
}
function4(){
consoleLog(this._myvar)
}
}
var myClass = new Myclass()
Does anyone know why running the following lines of code for the above class creates an unknown type error?:
myClass.function1();
myClass.function2(myClass.function3);
But running the following does not?:
myClass.function3();
myClass.function4();
I'm hoping this can be solved by binding in some way but I'm not sure how.