Skip to content

Latest commit

 

History

History
50 lines (41 loc) · 1.87 KB

repeat.md

File metadata and controls

50 lines (41 loc) · 1.87 KB

Object Agent

A javascript library for working with objects

npm build coverage deps size vulnerabilities license


repeat(times, callback)

Calls a callback a specified number of times.

Param Type Description
times number The number of times to call the callback.
callback function Provides one argument, a zero based index value of the call count.

Example

import { repeat } from 'object-agent';

repeat(5, (index) => console.log(index));
// => 0
// => 1
// => 2
// => 3
// => 4