* 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. * @param- {Object} [guard]
(array, n, guard)
| 7140 | * // => [1, 2, 3] |
| 7141 | */ |
| 7142 | function drop(array, n, guard) { |
| 7143 | var length = array == null ? 0 : array.length; |
| 7144 | if (!length) { |
| 7145 | return []; |
| 7146 | } |
| 7147 | n = (guard || n === undefined) ? 1 : toInteger(n); |
| 7148 | return baseSlice(array, n < 0 ? 0 : n, length); |
| 7149 | } |
| 7150 | |
| 7151 | /** |
| 7152 | * Creates a slice of `array` with `n` elements dropped from the end. |