Function isIndex

  • Checks if value is a valid array-like index.

    Parameters

    • value: unknown
    • length: number = MAX_SAFE_INTEGER

    Returns boolean

    Since

    1.0.0

    Example

    isIndex(0);
    // => true

    Example

    isIndex(10);
    // => true

    Example

    isIndex("10");
    // => true

    Example

    isIndex("foo");
    // => false