title: Is there an alias for 'this' in TypeScript?
body: <p>I've attempted to write a class in TypeScript that has a method defined which acts as an event handler callback to a jQuery event.</p>
  
  <pre><code>class Editor {
      textarea: JQuery;
  
      constructor(public id: string) {
          this.textarea = $(id);
          this.textarea.focusin(onFocusIn);
      }
  
      onFocusIn(e: JQueryEventObject) {
          var height = this.textarea.css('height'); // &lt;-- This is not good.
      }
  }
  </code></pre>
  
  <p>Within the onFocusIn event handler, TypeScript sees 'this' as being the 'this' of the class. However, jQuery overrides the this reference and sets it to the DOM object associated with the event. </p>
  
  <p>One alternative is to define a lambda within the constructor as the event handler, in which case TypeScript creates a sort of closure with a hidden _this alias.</p>
  
  <pre><code>class Editor {
      textarea: JQuery;
  
      constructor(public id: string) {
          this.textarea = $(id);
          this.textarea.focusin((e) =&gt; {
              var height = this.textarea.css('height'); // &lt;-- This is good.
          });
      }
  }
  </code></pre>
  
  <p>My question is, is there another way to access the this reference within the method-based event handler using TypeScript, to overcome this jQuery behavior?</p>