mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 15:27:50 +00:00
Make _.partial and _.partialRight docs complement each other. [ci skip] [closes #586]
This commit is contained in:
12
lodash.js
12
lodash.js
@@ -5820,9 +5820,9 @@
|
||||
* @example
|
||||
*
|
||||
* var greet = function(greeting, name) { return greeting + ' ' + name; };
|
||||
* var hi = _.partial(greet, 'hi');
|
||||
* hi('fred');
|
||||
* // => 'hi fred'
|
||||
* var sayHelloTo = _.partial(greet, 'hello');
|
||||
* sayHelloTo('fred');
|
||||
* // => 'hello fred'
|
||||
*/
|
||||
function partial(func) {
|
||||
if (func) {
|
||||
@@ -5849,6 +5849,12 @@
|
||||
* @returns {Function} Returns the new partially applied function.
|
||||
* @example
|
||||
*
|
||||
* var greet = function(greeting, name) { return greeting + ' ' + name; };
|
||||
* var greetFred = _.partialRight(greet, 'fred');
|
||||
* greetFred('hello');
|
||||
* // => 'hello fred'
|
||||
*
|
||||
* // create a deep `_.defaults`
|
||||
* var defaultsDeep = _.partialRight(_.merge, function deep(value, other) {
|
||||
* return _.merge(value, other, deep);
|
||||
* });
|
||||
|
||||
Reference in New Issue
Block a user