• Removes the first element from an Array that matches a Predicate.

    Mutation

    Example

    Square the first element equal to 2

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

    findAndDelete(isEven)(array);

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

    Type Parameters

    • T

      the Array element type

    Parameters

    • predicate: Predicate<[T, number, ArrayLike<T>]>

      the Predicate to match

    • Optional fromIndex: number

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

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

        • array: T[]

        Returns boolean

Generated using TypeDoc