Back to Lo

Core Noneby

docs/data/core-noneby.md

1.53.0229 B
Original Source

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

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