/** * Fills a chunk with the result of applying `f` `n` times. * * @tsplus static Chunk.Ops fill */ export function fill(n: number, f: (n: number) => A): Chunk { if (n <= 0) { return Chunk.empty() } let builder = Chunk.empty() for (let i = 0; i < n; i++) { builder = builder.append(f(i)) } return builder }