max_.max(list, [iteratee], [context])
Returns the maximum value in list. If an iteratee function is provided, it will be used on each value to generate the criterion by which the value is ranked. -Infinity is returned if list is empty, so an isEmpty guard may be required.
1 2 3 | var stooges = [{name: 'moe' , age: 40}, {name: 'larry' , age: 50}, {name: 'curly' , age: 60}]; _.max(stooges, function (stooge){ return stooge.age; }); => {name: 'curly' , age: 60}; |
Please login to continue.