@eroyeroy/utils - v0.1.0
    Preparing search index...

    Function removeArrayItem

    • Returns a new array with all occurrences of itemToRemove removed (by reference equality).

      Type Parameters

      • T

      Parameters

      • array: readonly T[]

        The source array.

      • itemToRemove: T

        The item to remove.

      Returns T[]

      removeArrayItem([1, 2, 3, 2], 2) // => [1, 3]
      removeArrayItem(["a", "b"], "c") // => ["a", "b"]