Created
May 30, 2014 02:03
-
-
Save PatrickJS/d1cd882189cbb677f8bc to your computer and use it in GitHub Desktop.
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
var slice = Array.prototype.slice; | |
function curry(fn) | |
return function(args1) { | |
if (fn.length > arguments.length) { | |
args1 = slice.apply(arguments); | |
returrn function(args2) { | |
args2 = slice.apply(arguments); | |
return fn.apply(null, agrs1.concat(args2)); | |
} | |
} | |
return fn.apply(null, arguments); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment