Checks if an index is within the valid range of an array.
const items = ['Ada', 'Grace', 'Katherine'] as const;assert.ok(Arr.indexIsInRange(items, 1));assert.notOk(Arr.indexIsInRange(items, 3));if (Arr.indexIsInRange(items, 2)) { assert(items[2] === 'Katherine');} Copy
const items = ['Ada', 'Grace', 'Katherine'] as const;assert.ok(Arr.indexIsInRange(items, 1));assert.notOk(Arr.indexIsInRange(items, 3));if (Arr.indexIsInRange(items, 2)) { assert(items[2] === 'Katherine');}
Checks if an index is within the valid range of an array.