mirror of
https://github.com/samber/lo.git
synced 2026-04-22 23:47:11 +08:00
544 B
544 B
name, slug, sourceRef, category, subCategory, playUrl, variantHelpers, similarHelpers, position, signatures
| name | slug | sourceRef | category | subCategory | playUrl | variantHelpers | similarHelpers | position | signatures | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| CountBy | countby | slice.go#L596 | core | slice | https://go.dev/play/p/ByQbNYQQi4X |
|
|
0 |
|
Counts the number of elements for which the predicate is true.
lo.CountBy([]int{1, 5, 1}, func(i int) bool {
return i < 4
})
// 2