title: Javascript - Use local var or this?
body: <p>I am working with prototype methods and here is the scenerio</p>
  
  <pre><code>function Foo () {
      this.x = 5;
      this.y = 2;
      this.z = this.addValues();
  }
  Foo.prototype = {
      addValues:  function (){
          return this.x + this.y; 
      }
  }
  </code></pre>
  
  <p>Obviously this is just a simple example; in real project, there will be lot of activities in the 'addValue' function. Is it fine to use 'this' keyword 100s of times or caching this to local variable helps any performance improvements. For example, the below will make any difference?</p>
  
  <pre><code>Foo.prototype = {
      addValues:  function (){
          var self = this;
          return self.x + self.y; 
      }
  }
  </code></pre>