Skip to main content

Vector.duplicates

duplicateson

Group: Selections
Aliases: duplicates

Documentation​

Returns only non-unique elements within the vector.

The returned duplicate elements are kept in the same order as the first duplicate appeared in the input.

Arguments​

  • on: A projection from the element type to the value of that element which determines the uniqueness criteria.

Examples​

Removing unique entries.​

      [1, 3, 1, 2, 2, 1] . duplicates == [1, 1, 2, 2, 1]