Function filterUniqueByField

  • Return an array of Elm, that is a subset of arr, and all the elements are pair-wise distinct by their values given by fieldGetter.

    Type Parameters

    • Elm

      the element type.

    • F

      the field type, or value type of Elm for comparison. Note that the type should be identity-comparable, because this implementation uses Javascript's Set.

    Parameters

    • arr: Iterable<Elm>

      the array to filter.

    • fieldGetter: ((elm) => F)

      the getter for the field, but can be arbitrary a transformer.

        • (elm): F
        • Parameters

          Returns F

    Returns Elm[]

    the filtered array.

Generated using TypeDoc