siegel
Version:
Web application development ecosystem
13 lines (12 loc) • 459 B
TypeScript
type RangeEach = <T>(arr: T[], from: number, to: number, cb: (elem: T, index: number) => boolean | void) => void;
/**
* Iterates through array in range. Execs callback on each iteration step.
* Breaks a loop if callback returns **true**
*
* @param arr Array to iterate over
* @param from Index to start iteration from
* @param to Index to iterate to
* @param cb to execute on each step
*/
declare const rangeEach: RangeEach;
export default rangeEach;