Skip to content

Instantly share code, notes, and snippets.

@creaux
Last active August 29, 2015 14:12
Show Gist options
  • Save creaux/65031de2d93b255c3ce2 to your computer and use it in GitHub Desktop.
Save creaux/65031de2d93b255c3ce2 to your computer and use it in GitHub Desktop.
Allows to add new method to classes with chaining functionality.
Function.prototype.method = function(name, fn) {
this.prototype[name] = fn;
return this;
}
name: Method helper
description: Allows to add new method to classes with chaining functionality
authors:
- Petr Juna
resources:
- Design Patterns
normalize_css: no
wrap: b
panel_js: 0
panel_css: 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment