Let me start with an example :
class Test {
constructor() {
this.isOn = false;
}
general(method) {
method();
}
off() {
this.isOn = false;
}
atTime() {
// this.off(); --> works
this.general(this.off); // --> does not work
}
}
let test = new Test();
test.atTime();
I thought I would pass this.off
as an argument but it seems I cannot.
Here's a live example : https://goo.gl/9hRTTw