Created
October 6, 2015 18:02
-
-
Save DrBoolean/2e7cf17a862885549a7a to your computer and use it in GitHub Desktop.
Debug_2
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 curry(fx) { | |
| var arity = fx.length; | |
| function f1() { | |
| var args = Array.prototype.slice.call(arguments, 0); | |
| if (args.length >= arity) return fx.apply(null, args); | |
| function f2() { | |
| return f1.apply(null, args.concat(Array.prototype.slice.call(arguments, 0))); | |
| } | |
| return f2; | |
| }; | |
| return f1; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment