javascript classes - is "this.varname" required for each use?
<p>I have a javascript class like this:</p>

<pre><code>function Foo() {
  this.x = 5;
  this.y = x + 10;
}
</code></pre>

<p>Does 'x' not get scoped to the instance of the class when I don't use '.this'? If so, how do we use callbacks then? I have something like:</p>

<pre><code>function Foo() {
  this.x = 5;

  this.grok = function() {
    jQuery(blah).animate({
      ..,
      function(){
        x = 55;
      }
    });
  }
}
</code></pre>

<p>so jquery gives a chance for a callback, but how do I access the 'x' member variable of the parent class in that context then?</p>

<p>Thanks</p>
