Back to Lo

Core Everyby

docs/data/core-everyby.md

1.53.0222 B
Original Source

Returns true if the predicate returns true for all elements in the collection, or if the collection is empty.

go
ok := lo.EveryBy(
    []int{1, 2, 3, 4},
    func(x int) bool {
        return x < 5
    },
)
// true