Function arrSome

  • Checks if at least one element in the array satisfies the provided predicate.

    Type Parameters

    • T

      The type of elements in the input array.

    Parameters

    • input: T[]

      The array to check.

    • predicate: ArrayPredicate<T>

      The predicate function to apply to each element.

    Returns boolean

    Returns true if at least one element in the array passes the test implemented by the provided function, otherwise false.

    Example

    const numbers = [1, 2, 3, 4, 5];
    const isEven = (num) => num % 2 === 0;
    arrSome(numbers, isEven);
    //=> true

Generated using TypeDoc