@arrows/array
Version:
Functional tools for JS arrays
13 lines (12 loc) • 332 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.last_ = void 0;
/**
* Retrieves the last element of the array.
*
* @param arr Initial array
* @returns Last element (undefined for an empty array)
*/
const last_ = (arr) => arr[arr.length - 1];
exports.last_ = last_;
exports.default = last_;
;