* Creates a slice of `array` with `n` elements taken from the beginning. * * @static * @memberOf _ * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to take. * @param- {Object} [guard] Enables use as a callb
(array, n, guard)
| 6957 | * // => [] |
| 6958 | */ |
| 6959 | function take(array, n, guard) { |
| 6960 | var length = array ? array.length : 0; |
| 6961 | if (!length) { |
| 6962 | return []; |
| 6963 | } |
| 6964 | if (guard ? isIterateeCall(array, n, guard) : n == null) { |
| 6965 | n = 1; |
| 6966 | } |
| 6967 | return baseSlice(array, 0, n < 0 ? 0 : n); |
| 6968 | } |
| 6969 | |
| 6970 | /** |
| 6971 | * Creates a slice of `array` with `n` elements taken from the end. |
nothing calls this directly
no test coverage detected