Skip to content

none

ts
function Array.none<T>(
    target: readonly T[],
    predicate: (
        value: NoInfer<T>,
        index: number,
        target: readonly NoInfer<T>[],
    ) => boolean,
): boolean

Returns true if no elements in array satisfy the provided predicate function, otherwise returns false.

Example

ts
import { Array } from "@monstermann/array";

Array.none([1, 2, 3, 4], (x) => x > 10); // true
ts
import { Array } from "@monstermann/array";

pipe(
    [1, 2, 3, 4],
    Array.none((x) => x > 10),
); // true