2 * The base implementation of `_.slice` without an iteratee call guard.
5 * @param {Array} array The array to slice.
6 * @param {number} [start=0] The start position.
7 * @param {number} [end=array.length] The end position.
8 * @returns {Array} Returns the slice of `array`.
10 function baseSlice(array, start, end) {
12 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 - start) >>> 0);
25 var result = Array(length);
26 while (++index < length) {
27 result[index] = array[index + start];
32 module.exports = baseSlice;