1 var baseSlice = require('./_baseSlice'),
2 toInteger = require('./toInteger');
5 * Creates a slice of `array` with `n` elements dropped from the beginning.
10 * @param {Array} array The array to query.
11 * @param {number} [n=1] The number of elements to drop.
12 * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`.
13 * @returns {Array} Returns the slice of `array`.
19 * _.drop([1, 2, 3], 2);
22 * _.drop([1, 2, 3], 5);
25 * _.drop([1, 2, 3], 0);
28 function drop(array, n, guard) {
29 var length = array ? array.length : 0;
33 n = (guard || n === undefined) ? 1 : toInteger(n);
34 return baseSlice(array, n < 0 ? 0 : n, length);
37 module.exports = drop;