title: Is this the right way to implement chaining in javascript?
body: <p>After reading up online I wrote this simple code that does addition and multiplication via chaining. But reading the code, it looks like to me, that the method "Result" makes the code less readable and kind of seems redundant. Can someone help me get rid of the Result function?</p>
  
  <pre><code>var Calculator = function () {
      var result = 0;
      this.Add = function (x) {
  
          result = result + x;
  
          return this;
      };
  
       this.Multiply = function (x) {
  
          result = result * x;
  
          return this;
      };
  
      this.Result = function () {
          return result;
      }
  
  };
  
  
  var total = new Calculator().Add(2).Add(3).Multiply(5);
  
  alert(total.Result());
  </code></pre>
  
  <p>What I am trying to achieve is</p>
  
  <pre><code>var total = new Calculator().Add(2).Add(3).Multiply(5);
  
  alert(total);
  </code></pre>