apparently there is an ecmascript proposal for this syntax: class Foo { a = 1; } which would assign `this.a = 1` on every /instance/, rather than the prototype. unsure how i feel about this. also adds private fields, which i feel very strongly Is Bad https://github.com/tc39/proposal-class-fields …
In my hypothetical world where JS is basically Ruby, `this` in a class body refers to the prototype
-
-
leave out `this` and you basically have bracket syntax
-
Yeah, after writing that last bit I realized how they came to the bracket syntax since everything else just drops the `this` -- Still opaque from reading if you don't already know it though.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.