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

    Function removeArrayItemByKey

    • Returns a new array with all items where item[key] === value removed.

      Type Parameters

      • T
      • K extends string | number | symbol

      Parameters

      • array: readonly T[]

        The source array.

      • key: K

        The key to match on.

      • value: T[K]

        The value to match.

      Returns T[]

      removeArrayItemByKey([{ id: 1 }, { id: 2 }, { id: 1 }], "id", 1)
      // => [{ id: 2 }]