times
_.times(iteratee, n)
# Ⓢ [Ⓣ][1] Ⓝ
Invokes the iteratee n times, returning an array of the results of
each invocation. The iteratee is invoked with one argument; (index).
Since
0.1.0
Arguments
iteratee(Function): The function invoked per iteration.n(number): The number of times to invokeiteratee.
Returns
(Array): Returns the array of results.
Example
_.times(String, 3);
// => ['0', '1', '2']
_.times(_.constant(0), 4);
// => [0, 0, 0, 0]