Files
lo/docs/data/it-uniqby.md
T
2025-10-08 14:55:05 +02:00

511 B

name, slug, sourceRef, category, subCategory, signatures, playUrl, variantHelpers, similarHelpers, position
name slug sourceRef category subCategory signatures playUrl variantHelpers similarHelpers position
UniqBy uniqby it/seq.go#L225 it sequence
func UniqBy[T any, U comparable, I ~func(func(T) bool)](collection I, transform func(item T) U) I
it#slice#uniq
core#slice#uniqby
core#slice#uniq
45

Returns a sequence with duplicate elements removed based on a transform function.

result := it.UniqBy(it.Range(1, 7), func(item int) int {
    return item % 3
})
// [1, 2, 3]