• Removes elements of an Array at a given index

    Mutation

    Example

    Delete a single element at index 1

    const array = [1, 2, 3];
    deleteAt(1)(array);
    console.log(array); // [1, 3]

    Example

    Delete two elements at index 1

    const array = [1, 2, 3, 4];
    deleteAt(1, 2)(array);
    console.log(array); // [1, 4]

    Returns

    true if an element was deleted, otherwise false

    Parameters

    • index: RelativeIndex

      the index to start deletion

    • deleteCount: number = 1

      the optional number of elements to delete

    Returns ((array: unknown[]) => boolean)

      • (array: unknown[]): boolean
      • Parameters

        • array: unknown[]

        Returns boolean

Generated using TypeDoc