Skip to content

Instantly share code, notes, and snippets.

@blankyao
Created February 18, 2011 06:55
Show Gist options
  • Save blankyao/833352 to your computer and use it in GitHub Desktop.
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
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