UNPKG

@prelude/array

Version:

Array module.

14 lines 380 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * @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]; }; exports.default = last; //# sourceMappingURL=last.js.map