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

    Returns

    A filtered array containing no duplicates.

    Type Parameters

    • T

    Parameters

    • arr: T[]

      Array to remove duplicates from.

    • comparator: ((left: T, right: T) => boolean) = ...

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

        • (left: T, right: T): boolean
        • Parameters

          • left: T
          • right: T

          Returns boolean

    Returns T[]

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