Returns the element in the source that has the maximum value according to the comparer.
Type of items in the source.
Comparer function to determine the maximum value.
Collector that returns the element in the source that has the maximum value according to the comparer.
const result = maxBy<number>((a, b) => a - b)([1, 2, 3]);console.log(result); // 3 Copy
const result = maxBy<number>((a, b) => a - b)([1, 2, 3]);console.log(result); // 3
Returns the element in the source that has the maximum value according to the comparer.