method Iterator.prototype.foldimport { Iterator } from "https://deno.land/x/ahh@v0.14.0/src/iterator.ts"; fold<U>(init: U, fn: (init: U, item: T) => U): UConsumes this and calls fn on each item to collect them into init. ExamplesExample 1 import { assert } from "../test_deps.ts"; import I from "./iterator.ts"; const sum = (a: number, b: number): number => a + b; const iter = I.fromIter([1, 2, 3]); assert(iter.fold(0, sum) === 6); Type ParametersUParametersinit: Ufn: (init: U, item: T) => UReturnsU