Files
lo/docs/data/core-noneby.md
T
2025-10-06 17:15:49 +02:00

718 B

name, slug, sourceRef, category, subCategory, playUrl, variantHelpers, similarHelpers, position, signatures
name slug sourceRef category subCategory playUrl variantHelpers similarHelpers position signatures
NoneBy noneby intersect.go#L91 core intersect https://go.dev/play/p/O64WZ32H58S
core#intersect#noneby
core#intersect#none
core#intersect#everyby
core#intersect#every
core#intersect#someby
core#intersect#some
core#intersect#containsby
core#intersect#contains
70
func NoneBy[T any](collection []T, predicate func(item T) bool) bool

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

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