I am unable to call private or non static method from static method in class, below is the example
class a {
fun1(){
console.log('fun1');
}
static staticfun(){
console.log('staticfun');
this.fun1();
}
}
a.staticfun();
I am trying to expose only staticfun method which internally calls all private methods, but this gives me this.fun1
is not a function. I tried to find many ways to find it with 'this', but it does work.
How do I call private instance methods inside static methods?