Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jhines2k7/86a8c75624e1600f6aba to your computer and use it in GitHub Desktop.
Save jhines2k7/86a8c75624e1600f6aba to your computer and use it in GitHub Desktop.
A function used to build complex functions from many simple, generic functions
Function.prototype.compose = function(prevFunc) {
var nextFunction = this;
return function() {
return nextFunction.call(this, prevFunc.apply(this, arguments));
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment