Skip to content

Instantly share code, notes, and snippets.

@edtsech
Created November 7, 2016 18:50
Show Gist options
  • Save edtsech/a7e7d9f32aefd29528875538d90fe6fe to your computer and use it in GitHub Desktop.
Save edtsech/a7e7d9f32aefd29528875538d90fe6fe to your computer and use it in GitHub Desktop.
rightCurry = function (f) {
let args = Array.prototype.slice.call(arguments).slice(1);
return function(firstArg) {
return f.apply(null, [firstArg].concat(args))
}
}
fullName = function (name, middleName, lastName) { return name + " " + middleName + " " + lastName }
// rightCurry(fullName, "David", "Doe")("John") -> "John David Doe"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment