Skip to content

Instantly share code, notes, and snippets.

@rochnyak-d-i
Last active August 29, 2015 14:08
Show Gist options
  • Save rochnyak-d-i/aa654adb39419c0aa0c1 to your computer and use it in GitHub Desktop.
Save rochnyak-d-i/aa654adb39419c0aa0c1 to your computer and use it in GitHub Desktop.
JS каррирование
function carry(fn) {
var
slice = Array.prototype.slice
, soredArgs = slice.call(arguments, 1)
;
return function() {
var
newArgs = slice.call(arguments)
, args = soredArgs.concat(newArgs)
;
return fn.apply(null, args);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment