Skip to content
This repository has been archived by the owner on Apr 1, 2023. It is now read-only.

Latest commit

 

History

History
50 lines (41 loc) · 1.85 KB

repeat.md

File metadata and controls

50 lines (41 loc) · 1.85 KB

Object Agent

A javascript library for working with objects

npm build coverage deps size vulnerabilities license


repeat(times, callback) ⇒ Array

Calls a callback a specified number of times

Param Type Description
times integer
callback function Provides one argument, an index value of the call count

Example

import { repeat } from 'object-agent';

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