* Creates a slice of `array` with `n` elements dropped from the beginning. * * @static * @memberOf _ * @since 0.5.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to drop.
(array, n, guard)
| 17672 | * // => [1, 2, 3] |
| 17673 | */ |
| 17674 | function drop(array, n, guard) { |
| 17675 | var length = array == null ? 0 : array.length; |
| 17676 | if (!length) { |
| 17677 | return []; |
| 17678 | } |
| 17679 | n = (guard || n === undefined) ? 1 : toInteger(n); |
| 17680 | return baseSlice(array, n < 0 ? 0 : n, length); |
| 17681 | } |
| 17682 | |
| 17683 | /** |
| 17684 | * Creates a slice of `array` with `n` elements dropped from the end. |