Skip to content

or

or<A>(p1, p2): (…args) => boolean

Defined in: Composition/fn.ts:73

Combines two predicates with logical OR.

A extends readonly unknown[]

(…args) => boolean

(…args) => boolean

(…args): boolean

A

boolean

const isNegative = (n: number) => n < 0;
const isZero = (n: number) => n === 0;
const isNonPositive = or(isNegative, isZero);

isNonPositive(-1); // true
isNonPositive(0); // true
isNonPositive(1); // false