Skip to content

some

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

Returns true if at least one element in array satisfies the provided predicate function, otherwise returns false.

Example

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

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

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