* Creates a slice of `array` with `n` elements dropped from the end. * * @static * @memberOf _ * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to drop. * @param- {Object} [guard] Enables use as a callback
(array, n, guard)
| 6149 | * // => [1, 2, 3] |
| 6150 | */ |
| 6151 | function dropRight(array, n, guard) { |
| 6152 | var length = array ? array.length : 0; |
| 6153 | if (!length) { |
| 6154 | return []; |
| 6155 | } |
| 6156 | if (guard ? isIterateeCall(array, n, guard) : n == null) { |
| 6157 | n = 1; |
| 6158 | } |
| 6159 | n = length - (+n || 0); |
| 6160 | return baseSlice(array, 0, n < 0 ? 0 : n); |
| 6161 | } |
| 6162 | |
| 6163 | /** |
| 6164 | * Creates a slice of `array` excluding elements dropped from the end. |
no test coverage detected