1 /* Built-in method references for those with the same name as other `lodash` methods. */
2 var nativeCeil = Math.ceil,
6 * The base implementation of `_.range` and `_.rangeRight` which doesn't
7 * coerce arguments to numbers.
10 * @param {number} start The start of the range.
11 * @param {number} end The end of the range.
12 * @param {number} step The value to increment or decrement by.
13 * @param {boolean} [fromRight] Specify iterating from right to left.
14 * @returns {Array} Returns the new array of numbers.
16 function baseRange(start, end, step, fromRight) {
18 length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
19 result = Array(length);
22 result[fromRight ? length : ++index] = start;
28 module.exports = baseRange;