mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 10:07:48 +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
|
* @example
|
||||||
*
|
*
|
||||||
* var greet = function(greeting, name) { return greeting + ' ' + name; };
|
* var greet = function(greeting, name) { return greeting + ' ' + name; };
|
||||||
* var hi = _.partial(greet, 'hi');
|
* var sayHelloTo = _.partial(greet, 'hello');
|
||||||
* hi('fred');
|
* sayHelloTo('fred');
|
||||||
* // => 'hi fred'
|
* // => 'hello fred'
|
||||||
*/
|
*/
|
||||||
function partial(func) {
|
function partial(func) {
|
||||||
if (func) {
|
if (func) {
|
||||||
@@ -5849,6 +5849,12 @@
|
|||||||
* @returns {Function} Returns the new partially applied function.
|
* @returns {Function} Returns the new partially applied function.
|
||||||
* @example
|
* @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) {
|
* var defaultsDeep = _.partialRight(_.merge, function deep(value, other) {
|
||||||
* return _.merge(value, other, deep);
|
* return _.merge(value, other, deep);
|
||||||
* });
|
* });
|
||||||
|
|||||||
Reference in New Issue
Block a user