UNPKG

@prelude/array

Version:

Array module.

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