Last active
December 16, 2015 00:59
-
-
Save schell/5351428 to your computer and use it in GitHub Desktop.
Function composition in javascript.
This file contains hidden or 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 compose(g, f) { | |
// Return our composure. | |
return function composedFuction() { | |
var args = Array.prototype.slice.call(arguments); | |
return f.call(null, g.apply(null, args)); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment