Arrow vs classic method in ES6 class
The feature you are using is not part of ES6. It’s the class fields proposal. It allows you to initialize instance properties without having to write a constructor. I.e. your code: class MyClass { myMethod = () => { this.myVariable++; } } is exactly the same as class MyClass { constructor() { this.myMethod = () … Read more