• Checks if a Number is a RelativeIndex of an ArrayLike

    Example

    A RelativeIndex can be negative

    const result = isRelativeIndex(index)([1, 2, 3]);

    console.log(result); // true

    Example

    Works with Strings, too

    const result = isRelativeIndex(-5)("test");

    console.log(result); // false

    Returns

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

    Parameters

    • index: number

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

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

        Returns boolean

Generated using TypeDoc