Combines Predicates with a logical AND.
AND
The combined Predicate returns true if all of the Predicates returns true.
true
Combine two Predicates with a logical AND
const predicate = and(numberIsPositive, numberIsEven);const result = p(2);console.log(result); // true
Returns an alwaysTrue Predicate if no args provided
const predicate = and();const result = p();console.log(result); // true
true if all Predicates return true, otherwise false
false
the type of the Predicates
Rest
the Predicates to combine
Generated using TypeDoc
Combines Predicates with a logical
AND.The combined Predicate returns
trueif all of the Predicates returnstrue.Example
Combine two Predicates with a logical
ANDExample
Returns an alwaysTrue Predicate if no args provided
Returns
trueif all Predicates returntrue, otherwisefalse