title: How to know if the called method is the last one
body: <p>Having an object like this:</p>
  
  <pre><code>var foo = {
      a: function () {
         /*
            if (lastCall) {
               return this.b();
            }
          */
         ...
         return this;
      }
    , b: function () { return ...; }
  };
  </code></pre>
  
  <p>How can I know, <em>inside</em> of the <code>a</code> method if the current <code>a</code> call is the last?</p>
  
  <pre><code>foo.a().a().a().a()
  //              ^- This should return another value
  //                 while the other calls return `this`
  </code></pre>
  
  <p>I know I can use a boolean value or something in the last call, but if possible, I would like to avoid that.</p>
  
  <p>So, is it possible to check if the current call is the last one in the stack?</p>