title: Javascript scope and self=this, _this=this, that=this
body: <p>Why is <code>_this.</code> not working but <code>this.</code> is working.  </p>
  
  <p>I thought the whole point of <code>_this=this</code> was to provide a mechanism for when object functions are called, you have a "guaranteed" reference back to the instantiated object as it is now within the closure of the object function to mimic traditional class behavior.  I've read so many pieces about scope and for some reason I'm just not seeing it.  What am I missing?</p>
  
  <pre><code>var PersonClass = function PersonClass(_name, _age) {
      _this=this;
      this.name=_name;
      this.age=_age;
  
      console.log("created "+this.name+":"+this.age);
  
      function changeAge(num) {
          console.log("changing age for:" + _this.name);
          _this.age=num;
      }
  
      PersonClass.prototype.changeAge=changeAge;
      PersonClass.prototype.getAge=function() { 
          console.log(_this.name+":"+_this.age);
          return _this.age;
      };
      PersonClass.prototype.getAge2=function() { 
          console.log(this.name+":"+this.age);        
          return this.age;
      };
  };
  
  // comments indicate what value is displayed in console
  var john=new PersonClass("john",1);  // john:1
  var sue=new PersonClass("sue",2);    // sue:2
  
  john.getAge(); // sue:2
  john.getAge2(); // john:1
  
  john.changeAge(10); // sue
  sue.getAge(); // sue:10
  sue.getAge2(); // sue:10
  john.getAge(); // sue:10
  john.getAge2(); // john:1
  </code></pre>