When using ES6 modules and export default class
how is it possible to call a static method from another method within the same class? My question refers specifically to when the class is marked as default (unlike es6 call static methods)
The below example illustrates how it is possible to call the static method from a non-static method when not using default, i.e. Test.staticMethod()
?
export default class {
static staticMethod(){
alert('static');
}
nonStaticMethod(){
// will not work because staticMethod is static.
// Ordinarily you would use MyClass.staticMethod()
this.staticMethod();
}
}