mirror of
https://github.com/samber/lo.git
synced 2026-04-22 23:47:11 +08:00
861 B
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 |
|
https://go.dev/play/p/KmX-fXictQl |
|
|
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)