Skip to content

reduce

reduce<A, B>(init, f): (s) => B

Defined in: Utils/Uniq.ts:253

Folds the collection into a single value by applying f to each item in insertion order.

A

B

B

(acc, a) => B

(s): B

ReadonlySet<A>

B

Uniq.reduce(0, (acc, n) => acc + n)(Uniq.fromArray([1, 2, 3])); // 6