/
asias
/
new
Обзор
Документация
Войти
/
asias
/
new
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
node_modules/underscore/modules/last.js
9 строк
372 B
AnastasyaDemina
project
07 дек 2025, 23:03
07 дек 2025, 23:03
7c21e25
Код
Авторство
О чём код?
import rest from './rest.js'; // Get the last element of an array. Passing **n** will return the last N // values in the array. export default function last(array, n, guard) { if (array == null || array.length < 1) return n == null || guard ? void 0 : []; if (n == null || guard) return array[array.length - 1]; return rest(array, Math.max(0, array.length - n)); }