source: node_modules/es-toolkit/dist/compat/array/takeRight.js@ a762898

Last change on this file since a762898 was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 583 bytes
Line 
1'use strict';
2
3Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
5const takeRight$1 = require('../../array/takeRight.js');
6const toArray = require('../_internal/toArray.js');
7const isArrayLike = require('../predicate/isArrayLike.js');
8const toInteger = require('../util/toInteger.js');
9
10function takeRight(arr, count = 1, guard) {
11 count = guard ? 1 : toInteger.toInteger(count);
12 if (count <= 0 || !isArrayLike.isArrayLike(arr)) {
13 return [];
14 }
15 return takeRight$1.takeRight(toArray.toArray(arr), count);
16}
17
18exports.takeRight = takeRight;
Note: See TracBrowser for help on using the repository browser.