1.0.0 • Published 5 years ago

@bakkerjoeri/repeat v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

repeat

Repeat a callback a given number of times.

Installation

npm install @bakkerjoeri/repeat

Usage

import repeat from '@bakkerjoeri/repeat';

const count = (i) => console.log(i);
repeat(3, count);
// => 0
// => 1
// => 2

The callback is called with a 0-based iteration count as its first argument.