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 …
Maybe I'm just a dinosaur, but `this[Symbol.iterator] = function() {... }` seemed fine
-
-
lmao fair enough, but this lets you keep it in the class body
-
In my hypothetical world where JS is basically Ruby, `this` in a class body refers to the prototype
- 2 more replies
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.