2 * The base implementation of `_.fill` without an iteratee call guard.
5 * @param {Array} array The array to fill.
6 * @param {*} value The value to fill `array` with.
7 * @param {number} [start=0] The start position.
8 * @param {number} [end=array.length] The end position.
9 * @returns {Array} Returns `array`.
11 function baseFill(array, value, start, end) {
12 var length = array.length;
14 start = start == null ? 0 : (+start || 0);
16 start = -start > length ? 0 : (length + start);
18 end = (end === undefined || end > length) ? length : (+end || 0);
22 length = start > end ? 0 : (end >>> 0);
25 while (start < length) {
26 array[start++] = value;
31 module.exports = baseFill;