Created
February 18, 2011 06:55
-
-
Save blankyao/833352 to your computer and use it in GitHub Desktop.
A simple helper that allows you to bind new functions to the prototype of an object
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.prototype.method = function(name, func) { | |
this.prototype[name] = func; | |
return this; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment