Back to Lo

Core Containsby

docs/data/core-containsby.md

1.53.0198 B
Original Source

Returns true if the predicate returns true for any element in the collection.

go
exists := lo.ContainsBy(
    []int{0, 1, 2, 3},
    func(x int) bool {
        return x == 3
    },
)
// true