43

If you haven't seen this already

Comments
  • 7
    Try arrow function
  • 2
    Try TypeScript. At least I ALWAYS know what this refers to :) (ES6 too, but still not supported at 100%)
  • 1
    @NoToJavaScript That has nothing to do with TypeScript. If you use "normal" functions as parameters, "this" will even refer to any other thing. The only way to prevent this, are arrow functions, and there are working in native JavaScript also.
  • 2
    this.shit = this.shit.bind(this);
Add Comment