method Iterator.prototype.foldimport { Iterator } from "https://deno.land/x/ahh@v0.12.1/src/iterator.ts"; fold<U>(init: U, fn: (init: U, _: T) => U): UConsumes an Iterator and calls fn on each item to collect them into init. ExamplesExample 1 import { default as I } from "./iterator.ts"; const iter = I.iter([1, 2, 3]); const arr = iter.fold<number[]>([], (arr, i) => { arr.push(i); return arr; }); console.log(arr); Type ParametersUParametersinit: Ufn: (init: U, _: T) => UReturnsU