Created
August 13, 2020 07:03
-
-
Save anil-pace/4132829b62bcdc8ee4c90e60b2a827df to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment