Comment Comment by bramen There's already a proposal for field declarations, where you can do the following: class Foo { bar = () => { console.log(this); } } This basically puts `this.bar = () => console.log(this)` in the constructor, and since it's an arrow function it captures the correct context.See https://github.com/tc39/proposal-class-fields. parent bramen 9 years ago
See https://github.com/tc39/proposal-class-fields.