Back to Lo

It Length

docs/data/it-length.md

1.53.0341 B
Original Source

Returns the length of a collection by iterating through the entire sequence.

Examples:

go
seq := func(yield func(int) bool) {
    _ = yield(1)
    _ = yield(2)
    _ = yield(3)
}
length := it.Length(seq)
// length == 3
go
seq := func(yield func(string) bool) {
    // empty sequence
}
length := it.Length(seq)
// length == 0