Created
July 8, 2015 18:33
-
-
Save jhines2k7/86a8c75624e1600f6aba to your computer and use it in GitHub Desktop.
A function used to build complex functions from many simple, generic functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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