Last active
March 22, 2017 14:50
-
-
Save marcveens/b7ed5f6b64636ace06d2dc89b92eb63a to your computer and use it in GitHub Desktop.
Chaining methods
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
| ;(function () { | |
| function utils() { } | |
| utils.prototype.customString = function(str) { | |
| this.value = str; | |
| return this; | |
| }; | |
| utils.prototype.toLower = function() { | |
| this.value = this.value.toLowerCase(); | |
| return this; | |
| }; | |
| utils.prototype.toValue = function() { | |
| return this.value; | |
| }; | |
| var line = new utils().customString('SomeText').toLower().toValue(); | |
| console.log(line); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment