es-toolkit
Version:
A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.
13 lines (10 loc) • 309 B
JavaScript
import { last as last$1 } from '../../array/last.mjs';
import { toArray } from '../_internal/toArray.mjs';
import { isArrayLike } from '../predicate/isArrayLike.mjs';
function last(array) {
if (!isArrayLike(array)) {
return undefined;
}
return last$1(toArray(array));
}
export { last };