JSFiddle - React, Tailwind, and code Playground
by Sahin Deniz
JavaScript 1.7
class StaticMethodCall {
constructor(){
console.log("hello from constructor");
}
static staticMethod() {
new StaticMethodCall();
return 'Static method has been called';
}
static anotherStaticMethod() {
return this.staticMethod() + ' from another static method';
}
}
let a = StaticMethodCall.staticMethod();
console.log(a);
// 'Static method has been called'
let b = StaticMethodCall.anotherStaticMethod();
console.log(b);