var calculator = { result: 0, one: function () { this.result = this.result + 1; return this; }, three: function () { this.result = this.result + 3; return this; }, five: function () { this.result = this.result + 5; return this; }, value: function () { console.log(this.result); } } calculator.one().three().five().value();