Created
November 23, 2011 10:32
-
-
Save KOBA789/1388359 to your computer and use it in GitHub Desktop.
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 () { | |
| return Array.prototype.reduce.call(arguments, function (f, g) { | |
| return function (x) { | |
| return f(g(x)); | |
| } | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment