title: Calculator function is not working, is showing function undefined
body: <p>Below funtion not working and showing "add is undefined". I am calculating by chaining the function calls.</p>
  
  <pre><code>var calc = {
    x: 5,
    add: function(num) {
      x = x + num;
      return x;
    },
    sub: function(num) {
      x = x - num;
      return x;
    },
    set: function(num) {
      x = num;
      return x;
    },
    print: function() {
      console.log(x);
    }
  }
  calc.set(5).add(3).sub(2).add(10).print();
  </code></pre>