mirror of
https://github.com/samber/lo.git
synced 2026-04-22 23:47:11 +08:00
686 B
686 B
name, slug, sourceRef, category, subCategory, signatures, playUrl, variantHelpers, similarHelpers, position
| name | slug | sourceRef | category | subCategory | signatures | playUrl | variantHelpers | similarHelpers | position | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Length | length | it/seq.go#L16 | it | sequence |
|
https://go.dev/play/p/3dnbOjTbL-o |
|
|
0 |
Returns the length of a collection by iterating through the entire sequence.
Examples:
seq := func(yield func(int) bool) {
_ = yield(1)
_ = yield(2)
_ = yield(3)
}
length := it.Length(seq)
// length == 3
seq := func(yield func(string) bool) {
// empty sequence
}
length := it.Length(seq)
// length == 0