Earlier quoted context omitted.
It is not legal JS as of January 2019. > Why would I put this.y = 10 in the constructor? Because that's how you initialize attributes of an object instance in JS, in January 2019. I don't believe this code does what you think it does. Even if your definition of `x` generated an attribute of instances of C, using an arrow function would defeat your apparent intention: arrow functions take their surrounding lexical sco…
> It is not legal JS as of January 2019. Ah, true. I keep forgetting class fields are not standardized yet since eve ryone is using them anyway just because they are so damn handy. > Even if your definition of `x` generated an attribute of instances of C, using an arrow function would defeat your apparent intention: arrow functions take their surrounding lexical scope's `this`, which in this case is the class, not an…
Using an arrow function on a class field seems like a way to get static methods that are still callable from the instance. But I'm not sure I have a burning need for that at the moment...