Skip to main content
variable times
import { times } from "https://deno.land/x/30_seconds_of_typescript@v1.0.1/util.ts";

Iterates over a callback n times

Use Function.call() to call fn n times or until it returns false. Omit the last argument, context, to use an undefined object (or the global object in non-strict mode).

type

(
n: number,
fn: Function,
context?: any,
) => unknown