bramen
Joined 10 years ago
Karma
108
Submissions
45
Member since
Jan 24
Joined 10 years ago
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.