Skip to content

Instantly share code, notes, and snippets.

@thevangelist
Created January 4, 2017 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thevangelist/71c5a55ad5b215a528c473d00d0fdd89 to your computer and use it in GitHub Desktop.
Save thevangelist/71c5a55ad5b215a528c473d00d0fdd89 to your computer and use it in GitHub Desktop.
Douglas Crockford's method method
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