Files
lo/docs/data/it-some.md
T

861 B

name, slug, sourceRef, category, subCategory, signatures, playUrl, variantHelpers, similarHelpers, position
name slug sourceRef category subCategory signatures playUrl variantHelpers similarHelpers position
Some some it/intersect.go#L52 it intersect
func Some[T comparable](collection iter.Seq[T], subset ...T) bool
https://go.dev/play/p/KmX-fXictQl
it#intersect#some
core#slice#some
it#intersect#every
it#intersect#none
40

Returns true if at least one element of a subset is contained in a collection.

Examples:

seq := func(yield func(int) bool) {
    _ = yield(1)
    _ = yield(2)
    _ = yield(3)
    _ = yield(4)
    _ = yield(5)
}
hasAny := it.Some(seq, 2, 6)
// hasAny == true (2 is in collection)
seq := func(yield func(string) bool) {
    _ = yield("apple")
    _ = yield("banana")
    _ = yield("cherry")
}
hasAny := it.Some(seq, "orange", "grape")
// hasAny == false (neither is in collection)