Skip to main content

type max

Returns a Reducer that remembers the maximum value of the numberic inputs.

example
console.log(Stream.of(5, 3, 7, 4).reduce(Reducer.max()))
// => 7

Definition

max: {
    (): AsyncReducer<number, number | undefined>;
    <O>(otherwise: AsyncOptLazy<O>): AsyncReducer<number, number | O>;
  }