@prelude/array
Version:
Array module.
14 lines • 430 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @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];
};
exports.default = at;
//# sourceMappingURL=at.js.map