Syntax: maxBy (comparer {(a, b) ==> diff})
Returns the maximum value in a sequence of values, using specified comparer.
Syntax: maxBy (comparer {(a, b) ==> diff}, selector {(v, k) ==> value})
Invokes a transform function on each element of a sequence and returns the maximum value, using specified comparer.
public maxBy ( callable $comparer, callable | null $selector = null ) : number | ||
$comparer | callable | {(a, b) ==> diff} Difference between a and b: <0 if a<b; 0 if a==b; >0 if a>b |
$selector | callable | null | {(v, k) ==> value} A transform function to apply to each element. Default: value. |
return | number | The maximum value in the sequence. |