Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/rimbu/core/mod.ts>Reducer.max

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
variable Reducer.max
import { Reducer } from "https://deno.land/x/rimbu@1.2.0/core/mod.ts";
const { max } = Reducer;

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

Examples

Example 1

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

type

{ (): Reducer<number, number | undefined>; <O>(otherwise: OptLazy<O>): Reducer<number, number | O>; }