Skip to content

Instantly share code, notes, and snippets.

@mkuklis
Created June 14, 2011 04:42
Show Gist options
  • Save mkuklis/1024340 to your computer and use it in GitHub Desktop.
Save mkuklis/1024340 to your computer and use it in GitHub Desktop.
Douglas Crockford's method helper
Function.prototype.method = function (name, func) {
if (!this.prototype[name]) {
this.prototype[name] = func;
return this;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment