Comment

Comment by supergreg

The case would be solved if they added some syntax to bind a function to the class. Something like

    class Foo {
      bind function bar() {
        console.log(this);
      }
    }
So behind the scene it would do `this.bar = this.bar.bind(this);`
parent supergreg 9 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton