Function unique

  • Returns a new array with the unique values in array, using an optional function to return the key.

    Returns

    the unique values in array

    Type Parameters

    • T

    Parameters

    • array: T[]

      an array of values

    • Optional by: ((a: T) => string | number)

      an optional function that returns a unique key for each value

        • (a: T): string | number
        • Parameters

          • a: T

          Returns string | number

    Returns T[]

Generated using TypeDoc