• Combines Predicates with a logical OR.

    The combined Predicate returns true if any of the Predicates returns true.

    Example

    Combine two Predicates with a logical OR

    const predicate = or(numberIsPositive, numberIsEven);
    const result = p(-2);
    console.log(result); // true

    Example

    Returns an alwaysFalse Predicate if no args provided

    const predicate = or();
    const result = p();
    console.log(result); // false

    Returns

    true if any of the Predicates returned true, otherwise false

    Type Parameters

    • T extends unknown[]

      the type of the Predicates

    Parameters

    Returns Predicate<T>

Generated using TypeDoc