UNPKG

@prelude/array

Version:

Array module.

12 lines 300 B
/** * @returns last element of an array. * @throws {TypeError} */ const last = (values) => { if (!values.length) { throw new TypeError('Expected non empty array to get last element.'); } return values[values.length - 1]; }; export default last; //# sourceMappingURL=last.js.map