|
123456789101112131415161718192021222324252627282930313233343536373839 |
- var baseSlice = require('./_baseSlice'),
- toInteger = require('./toInteger');
-
-
- function takeRight(array, n, guard) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- n = (guard || n === undefined) ? 1 : toInteger(n);
- n = length - n;
- return baseSlice(array, n < 0 ? 0 : n, length);
- }
-
- module.exports = takeRight;
|