Created
October 15, 2014 03:51
-
-
Save bpceee/5577f633dd9feb9d1c4d to your computer and use it in GitHub Desktop.
partial function
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
function partial(f) { | |
var args = Array.prototype.slice.call(arguments, 1) | |
return function() { | |
var remainingArgs = Array.prototype.slice.call(arguments) | |
return f.apply(null, args.concat(remainingArgs)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment