The function to partially apply arguments to.
Rest
...partials: any[]The arguments to be partially applied.
Rest
Returns the new partially applied function.
Rest
...args: any[]Rest
5.5.0
function greet(greeting, name) {
return greeting + ' ' + name;
}
var greetFred = partialRight(greet, 'fred');
greetFred('hi');
// => 'hi fred'
// Partially applied with placeholders.
var sayHelloTo = partialRight(greet, 'hello', _);
sayHelloTo('fred');
// => 'hello fred'
Creates a function that invokes
func
withpartials
prepended to the arguments it receives. This method is likebind
except it does not alter thethis
binding.The
partial.placeholder
value, which defaults to_
in monolithic builds, may be used as a placeholder for partially applied arguments.Note: This method doesn't set the "length" property of partially applied functions.