Skip to main content
Module

x/lazy/lib/lazy.ts>Lazy#aggregate

A linq-like lazy-evaluation enumerable/iteration library that aims to support deno, node & browser
Latest
method Lazy.prototype.aggregate
import { Lazy } from "https://deno.land/x/lazy@v1.7.3/lib/lazy.ts";

Applies an accumulator function over an interable.

Parameters

agg: AggFn<TElement, TElement>

The accumulator function to apply over the iterable.

Returns

TElement

The final accumulator value.

Applies an accumulator function over an interable.

Parameters

agg: AggFn<TElement, TAcc>

The accumulator function to apply over the iterable.

seed: TAcc

The seed to set the initial acc param to in the accumulator function. If not given, then the first element is used.

Returns

The final accumulator value.