• Find an element within the Array and remove it from the array

    Type Parameters

    • T

    Parameters

    • find: (element: T) => boolean

      A function to use as input to findIndex

    • Optionalreplace: T

      A replacement for the spliced element

    Returns null | T

    The replacement element, the removed element, or null if no element was found.

    Array#splice