UNPKG

@prelude/array

Version:

Array module.

12 lines 350 B
/** * @returns value at `index`. * @throws {TypeError} if index is out of bounds. */ const at = (values, index) => { if (index < 0 || index >= values.length) { throw new TypeError(`Index ${index} out of bounds for array of length ${values.length}.`); } return values[index]; }; export default at; //# sourceMappingURL=at.js.map