Function unique

Returns a new array with unique values from the source array.

unique([1, 2, 3, 2, 1]) // [1, 2, 3]
  • Type Parameters

    • V

      The type of the elements in the source array.

    Parameters

    • source: readonly V[]

      The source array.

    Returns V[]

    A new array with unique values.