• Filter an array by removing duplicates and keeping the left most occurrence. By default this compares by identity.

    Type Parameters

    • T

    Parameters

    • arr: T[]

      Array to remove duplicates from.

    • Optionalcomparator: ((left: T, right: T) => boolean)

      Optional comparator function, indicating whether two items are equal and therefore handled as duplicates. Defaults to identity.

        • (left, right): boolean
        • Parameters

          • left: T
          • right: T

          Returns boolean

    Returns T[]

    A filtered array containing no duplicates.

    Copyright Ⓒ 2024 SAP SE or an SAP affiliate company. All rights reserved.