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