* Creates a slice of `array` with `n` elements taken from the end. * * @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 callback fo
(array, n, guard)
| 6992 | * // => [] |
| 6993 | */ |
| 6994 | function takeRight(array, n, guard) { |
| 6995 | var length = array ? array.length : 0; |
| 6996 | if (!length) { |
| 6997 | return []; |
| 6998 | } |
| 6999 | if (guard ? isIterateeCall(array, n, guard) : n == null) { |
| 7000 | n = 1; |
| 7001 | } |
| 7002 | n = length - (+n || 0); |
| 7003 | return baseSlice(array, n < 0 ? 0 : n); |
| 7004 | } |
| 7005 | |
| 7006 | /** |
| 7007 | * Creates a slice of `array` with elements taken from the end. Elements are |
nothing calls this directly
no test coverage detected