class Play { static meStaticMethod() { prn(this===Play); //prints true } }
class Play { static getFoo() { return this.Foo ?? (this.Foo = 'Me Static!!'); } } console.log(Play.getFoo()); //prints 'Me Static!!'
class Play { static getFoo() { if (!this.Foo) this.Foo = 'Me Static'; return this.Foo; } } console.log(Play.getFoo()); //prints 'Me Static'