mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 23:37:49 +00:00
Cleanup _.maxBy and _.minBy doc example. [ci skip]
This commit is contained in:
26
lodash.js
26
lodash.js
@@ -13634,17 +13634,14 @@
|
||||
* @returns {*} Returns the maximum value.
|
||||
* @example
|
||||
*
|
||||
* var users = [
|
||||
* { 'user': 'barney', 'age': 36 },
|
||||
* { 'user': 'fred', 'age': 40 }
|
||||
* ];
|
||||
* var objects = [{ 'n': 1 }, { 'n': 2 }];
|
||||
*
|
||||
* _.maxBy(users, function(o) { return o.age; });
|
||||
* // => { 'user': 'fred', 'age': 40 }
|
||||
* _.maxBy(objects, function(o) { return o.a; });
|
||||
* // => { 'n': 2 }
|
||||
*
|
||||
* // using the `_.property` iteratee shorthand
|
||||
* _.maxBy(users, 'age');
|
||||
* // => { 'user': 'fred', 'age': 40 }
|
||||
* _.maxBy(objects, 'n');
|
||||
* // => { 'n': 2 }
|
||||
*/
|
||||
function maxBy(array, iteratee) {
|
||||
return (array && array.length)
|
||||
@@ -13705,17 +13702,14 @@
|
||||
* @returns {*} Returns the minimum value.
|
||||
* @example
|
||||
*
|
||||
* var users = [
|
||||
* { 'user': 'barney', 'age': 36 },
|
||||
* { 'user': 'fred', 'age': 40 }
|
||||
* ];
|
||||
* var objects = [{ 'n': 1 }, { 'n': 2 }];
|
||||
*
|
||||
* _.minBy(users, function(o) { return o.age; });
|
||||
* // => { 'user': 'barney', 'age': 36 }
|
||||
* _.minBy(objects, function(o) { return o.a; });
|
||||
* // => { 'n': 1 }
|
||||
*
|
||||
* // using the `_.property` iteratee shorthand
|
||||
* _.minBy(users, 'age');
|
||||
* // => { 'user': 'barney', 'age': 36 }
|
||||
* _.minBy(objects, 'n');
|
||||
* // => { 'n': 1 }
|
||||
*/
|
||||
function minBy(array, iteratee) {
|
||||
return (array && array.length)
|
||||
|
||||
Reference in New Issue
Block a user