Checks if a Number is an index of an ArrayLike
Is index in bounds of array?
index
array
const result = isIndex(4)([1, 2, 3]);console.log(result); // false
Works with strings, too
const result = isIndex(3)("test");console.log(result); // true
true if the index is between 0 and array.length, otherwise false
true
0
array.length
false
Generated using TypeDoc
Checks if a Number is an index of an ArrayLike
Example
Is
indexin bounds ofarray?Example
Works with strings, too
Returns
trueif theindexis between0andarray.length, otherwisefalse