Checks if every element in an array passes a given predicate.
const areAllPositive = every((x: number) => x > 0);const a = areAllPositive([1, 2, 3]); // trueconst b = areAllPositive([-1, 0, 1]); // false Copy
const areAllPositive = every((x: number) => x > 0);const a = areAllPositive([1, 2, 3]); // trueconst b = areAllPositive([-1, 0, 1]); // false
Checks if every element in an array passes a given predicate.
Example