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 [`Array#slice`](https://mdn.io/Array/slice)
9 * to ensure dense arrays are returned.
14 * @param {Array} array The array to slice.
15 * @param {number} [start=0] The start position.
16 * @param {number} [end=array.length] The end position.
17 * @returns {Array} Returns the slice of `array`.
19 function slice(array, start, end) {
20 var length = array ? array.length : 0;
24 if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
29 start = start == null ? 0 : toInteger(start);
30 end = end === undefined ? length : toInteger(end);
32 return baseSlice(array, start, end);
35 module.exports = slice;