Created
January 4, 2017 17:41
-
-
Save thevangelist/71c5a55ad5b215a528c473d00d0fdd89 to your computer and use it in GitHub Desktop.
Douglas Crockford's method method
This file contains 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.prototype.method = function (name, func) { | |
this.prototype[name] = func; | |
return this; | |
}; | |
/* | |
http://stackoverflow.com/questions/3966936/method-method-in-crockfords-book-javascript-the-good-parts | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment