mirror of
https://github.com/samber/lo.git
synced 2026-04-22 23:47:11 +08:00
842 B
842 B
name, slug, sourceRef, category, subCategory, signatures, playUrl, variantHelpers, similarHelpers, position
| name | slug | sourceRef | category | subCategory | signatures | playUrl | variantHelpers | similarHelpers | position | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Every | every | it/intersect.go#L25 | it | intersect |
|
https://go.dev/play/p/rwM9Y353aIC |
|
|
30 |
Returns true if all elements of a subset are contained in a collection.
Examples:
seq := func(yield func(int) bool) {
_ = yield(1)
_ = yield(2)
_ = yield(3)
_ = yield(4)
_ = yield(5)
}
hasAll := it.Every(seq, 2, 4)
// hasAll == true
seq := func(yield func(string) bool) {
_ = yield("apple")
_ = yield("banana")
_ = yield("cherry")
}
hasAll := it.Every(seq, "apple", "orange")
// hasAll == false (orange is not in collection)