Fix _.partialRight doc example. [ci skip] [closes #540]

This commit is contained in:
John-David Dalton
2014-05-02 22:33:17 -07:00
parent 925197ae09
commit 40809e40c2

View File

@@ -5415,20 +5415,15 @@
* @returns {Function} Returns the new partially applied function.
* @example
*
* var defaultsDeep = _.partialRight(_.merge, _.defaults);
* var defaultsDeep = _.partialRight(_.merge, function deep(value, other) {
* return _.merge(value, other, deep);
* });
*
* var options = {
* 'variable': 'data',
* 'imports': { 'jq': $ }
* };
* var object = { 'a': { 'b': { 'c': 1 } } },
* source = { 'a': { 'b': { 'c': 2, 'd': 2 } } };
*
* defaultsDeep(options, _.templateSettings);
*
* options.variable
* // => 'data'
*
* options.imports
* // => { '_': _, 'jq': $ }
* defaultsDeep(object, source);
* // => { 'a': { 'b': { 'c': 1, 'd': 2 } } }
*/
function partialRight(func) {
if (func) {