title: Javascript accessing functions of same class
body: <p>In the following code:</p>
  
  <pre><code>function xyz(x) {
            //something
            this.x = x;
          }
          xyz.prototype = {
              a: function () {
                  //do something
              },
              b: function () {
                  //pre
                  this.a();
                  //post
              }
          }
  </code></pre>
  
  <p>the call of <code>this.a()</code> gives the warning of <code>method not supported</code>. So I tried using <code>xyz.prototype.a.call(this)</code> instead. But it does not maintain the value of x. What do I do to call one method of a class from other? </p>