diff --git a/lodash.js b/lodash.js index 61c5dcf24..8d3791523 100644 --- a/lodash.js +++ b/lodash.js @@ -12832,6 +12832,21 @@ * @param {Array} pairs The predicate-function pairs. * @returns {Function} Returns the new function. * @example + * + * var func = _.cond([ + * [_.matches({ 'a': 1 }), _.constant('matches A')], + * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')], + * [_.constant(true), _.constant('no match')] + * ]) + * + * func({ 'a': 1, 'b': 2 }); + * // => 'matches A' + * + * func({ 'a': 0, 'b': 1 }); + * // => 'matches B' + * + * func({ 'a': '1', 'b': '2' }); + * // => 'no match' */ function cond(pairs) { var length = pairs ? pairs.length : 0,