1 var baseSlice = require('./_baseSlice'),
2 isIterateeCall = require('./_isIterateeCall'),
3 toInteger = require('./toInteger');
6 * Creates a slice of `array` from `start` up to, but not including, `end`.
8 * **Note:** This method is used instead of
9 * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
16 * @param {Array} array The array to slice.
17 * @param {number} [start=0] The start position.
18 * @param {number} [end=array.length] The end position.
19 * @returns {Array} Returns the slice of `array`.
21 function slice(array, start, end) {
22 var length = array == null ? 0 : array.length;
26 if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
31 start = start == null ? 0 : toInteger(start);
32 end = end === undefined ? length : toInteger(end);
34 return baseSlice(array, start, end);
37 module.exports = slice;