• Removes the first element from an Array that is equal to a value.

    Mutation

    Example

    Delete the first element equal to 2

    const array = [1, 2, 3, 2];

    deleteFirst(2)(array);

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

    Returns

    true if an element was deleted, otherwise false

    Type Parameters

    • T

      the Array element type

    Parameters

    • value: T

      the value to delete from the Array

    • Optional fromIndex: number

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

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

        • array: T[]

        Returns boolean

Generated using TypeDoc