• Checks if a Number is an index of an ArrayLike

    Example

    Is index in bounds of array?

    const result = isIndex(4)([1, 2, 3]);

    console.log(result); // false

    Example

    Works with strings, too

    const result = isIndex(3)("test");

    console.log(result); // true

    Returns

    true if the index is between 0 and array.length, otherwise false

    Parameters

    • index: number

    Returns ((array: ArrayLike<unknown>) => boolean)

      • (array: ArrayLike<unknown>): boolean
      • Parameters

        Returns boolean

Generated using TypeDoc