title: how can i return class method result only after last call
body: <pre><code>`enter code here`
  class SmartCalculator {
    constructor(initialValue) {
  
    this.priority = 0;
    this.decision = initialValue;
  
    }
  
    add(number) {
    this.priority = 2
    this.decision = this.decision + number
   //return this.decision 
    }
  
    subtract(number) {
    this.priority = 2
    }
  
    multiply(number) {
    this.priority = 1
    }
  
    devide(number) {
    this.priority = 1
    }
  
    pow(number) {
    this.priority = 0
    }
  }
  module.exports = SmartCalculator;
  </code></pre>
  
  <p>I have js class, and some test thats looks like:</p>
  
  <pre><code>const calculator = new SmartCalculator(1);
  
  const value = calculator
    .add(5)
    .add(5);
  
  assert.equal(value, 11);
  });
  </code></pre>
  
  <p>If I return the result immediately after calling the add method, I get an error.
  How can I return the result only after the last method  ?</p>