Created
November 30, 2014 23:24
-
-
Save alexeyraspopov/3c52bc23e057df229cd4 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(f){ | |
var n = f.length; | |
return function curried(as){ | |
return function(){ | |
var args = as.concat(slice.call(arguments)) | |
return args.length < n ? curried(args) : f.apply(null, args); | |
}; | |
}([]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment