Reducer which applies optional pred function to each value and terminates early if the predicate returned a falsy result. If no predicate is given the values are checked via JS native truthiness rules (i.e. 0, "", false, null, undefined are all falsy).
Reducer which applies optional
pred
function to each value and terminates early if the predicate returned a falsy result. If no predicate is given the values are checked via JS native truthiness rules (i.e. 0, "", false, null, undefined are all falsy).Returns true if all values passed test.
reduce(every((x)=> x > 0), [1,2,-1,3]); // false