Files
2025-11-28 19:45:44 -07:00

12 lines
286 B
JavaScript

import { toInteger } from '../compat/util/toInteger.mjs';
function takeRight(arr, count, guard) {
count = guard || count === undefined ? 1 : toInteger(count);
if (count <= 0 || arr.length === 0) {
return [];
}
return arr.slice(-count);
}
export { takeRight };