• Removes an element from an array by its index in the array.

    Type Parameters

    • T

    Parameters

    • array: T[]
    • index: number

      The index of the item to remove

    Returns T[]

    The new array resulting from the removal of the index item

    Example

    const original = ['a', 'b'];
    const result = remove(original, 1);
    console.log(result);
    ['a']

Generated using TypeDoc