Back to Lo

Core Reject

docs/data/core-reject.md

1.53.0203 B
Original Source

Returns the elements for which the predicate returns false (opposite of Filter).

go
lo.Reject(
    []int{1, 2, 3, 4},
    func(x int, _ int) bool {
        return x%2 == 0
    },
)
// []int{1, 3}