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

    Type Parameters

    • T


    • arr: T[]

      Array to remove duplicates from.

    • comparator: ((left, right) => 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.