I have this class which does an internal call to a static method:
export class GeneralHelper extends BaseHelper{
static is(env){
return config.get('env:name') === env;
}
static isProd(){
return GeneralHelper.is('prod');
}
}
Are there any keywords I can use to replace the class name in the line below:
GeneralHelper.is('prod');
In PHP there are self
, static
etc. Does ES6 provide anything similar to these?
TY.
if you are calling the static function from inside an instance, the right way to refer to the class static function is:
this.constructor.functionName();