majority
any →
majority(
...predicates: predicate
) → boolean
Returns true when strictly more than half of the supplied predicates are satisfied by the input. Returns false when no predicates are supplied and stops evaluating as soon as the result is known.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
predicates | predicate | Variadic (zero or more) | Specifies the predicate expressions evaluated against the same input value, in declaration order. |
Argument evaluation
predicates: Predicates use the same incoming value and are evaluated in declaration order. Evaluation stops as soon as the result is known.
Examples
4 | majority(is-positive, is-even, is-less-than(10)) → #true
Kind: Predicate
Scope: boolean
Aliases: None