Documentation
    Preparing search index...

    Function remove

    • Removes the first matching element from an array.

      Type Parameters

      • T

        type of the array element. The type parameter is intentionally declared as such to avoid handling tuples. While it is possible to remove item from tuple, it will impact typing soundness.

      • TItem

      Parameters

      • array: T[]

        array to remove the element from.

      • item: TItem

        value of the array element to be removed.

      Returns TItem extends T ? boolean : false

      true if the item is found in array, and thus the item has been removed; false otherwise.

    • Removes the first matching element from an array.

      Type Parameters

      • T

        type of the array element. The type parameter is intentionally declared as such to avoid handling tuples. While it is possible to remove item from tuple, it will impact typing soundness.

      Parameters

      • array: T[]

        array to remove the element from.

      • item: T

        value of the array element to be removed.

      Returns boolean

      true if the item is found in array, and thus the item has been removed; false otherwise.