Files
lo/docs/data/it-isempty.md
T
2025-10-06 17:16:33 +02:00

646 B

name, slug, sourceRef, category, subCategory, signatures, playUrl, variantHelpers, similarHelpers, position
name slug sourceRef category subCategory signatures playUrl variantHelpers similarHelpers position
IsEmpty isempty it/type_manipulation.go#L50 it type
func IsEmpty[T any](collection iter.Seq[T]) bool
it#type#isempty
it#type#isnotempty
it#type#empty
it#sequence#length
10

Returns true if the sequence is empty. Will consume the entire sequence to check.

Examples:

seq := func(yield func(int) bool) {
    // empty sequence
}
empty := it.IsEmpty(seq)
// empty == true
seq := func(yield func(int) bool) {
    _ = yield(1)
    _ = yield(2)
}
empty := it.IsEmpty(seq)
// empty == false