maxBy
maxBy<
T>(iterable,valueOf):T|null
Defined in: select/max-by.ts:15
Returns the item with the largest valueOf(item), or null if the iterable
is empty. Ties resolve to the first item seen.
Time complexity: O(n), with one valueOf call per item.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”iterable
Section titled “iterable”Iterable<T>
The input iterable.
valueOf
Section titled “valueOf”Callable<[T], number>
Numeric key extractor.
Returns
Section titled “Returns”T | null
The maximum item, or null for an empty iterable.