* The base implementation of `_.slice` without an iteratee call guard. * * @private * @param {Array} array The array to slice. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the slice of
(array, start, end)
| 4107 | * @returns {Array} Returns the slice of `array`. |
| 4108 | */ |
| 4109 | function baseSlice(array, start, end) { |
| 4110 | var index = -1, |
| 4111 | length = array.length; |
| 4112 | |
| 4113 | if (start < 0) { |
| 4114 | start = -start > length ? 0 : (length + start); |
| 4115 | } |
| 4116 | end = end > length ? length : end; |
| 4117 | if (end < 0) { |
| 4118 | end += length; |
| 4119 | } |
| 4120 | length = start > end ? 0 : ((end - start) >>> 0); |
| 4121 | start >>>= 0; |
| 4122 | |
| 4123 | var result = Array(length); |
| 4124 | while (++index < length) { |
| 4125 | result[index] = array[index + start]; |
| 4126 | } |
| 4127 | return result; |
| 4128 | } |
| 4129 | |
| 4130 | /** |
| 4131 | * The base implementation of `_.some` without support for iteratee shorthands. |
no outgoing calls
no test coverage detected