yz3456
2024-05-28 eb8655f4b9c0df4a6f14805a22131e79dac03654
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/**
 * The base implementation of `_.times` without support for iteratee shorthands
 * or max array length checks.
 *
 * @private
 * @param {number} n The number of times to invoke `iteratee`.
 * @param {Function} iteratee The function invoked per iteration.
 * @returns {Array} Returns the array of results.
 */
function baseTimes(n, iteratee) {
  var index = -1,
      result = Array(n);
 
  while (++index < n) {
    result[index] = iteratee(index);
  }
  return result;
}
 
module.exports = baseTimes;