UNPKG

@newdash/newdash

Version:

javascript/typescript utility library

22 lines (21 loc) 591 B
/** * Invokes the iteratee `n` times, returning an array of the results of * each invocation. The iteratee is invoked with one argument: (index). * * @since 5.0.0 * @category Util * @param n The number of times to invoke `iteratee`. * @param iteratee The function invoked per iteration. * @returns Returns the array of results. * @example * * ```js * times(3, String) * // => ['0', '1', '2'] * * times(4, () => 0) * // => [0, 0, 0, 0] * ``` */ export declare function times<T extends (...args: any[]) => any>(n: number, iteratee?: T): ReturnType<T>; export default times;