Repeat π
Last updated
Was this helpful?
Last updated
Was this helpful?
Repeat is a common function composed of function arguments that recursively invoke a callback function based on iterations returning a final value.
The repeat function can be used to replace while loops.
yarn add @common-utilities/repeat -D
const add1 = (val) => val + 1
repeat(100)(add1)(0) // 100
No cruft. No bloat. No dependencies.
Simple, typed, functional, documented, and tested javascript utility functions.
View other common utilities on Github.