Reduce function that returns true if all of the values are truthy.
let vals = [ 1, true, {}, "hello world"];vals.reduce(allTrueR, true); // truevals.push(0);vals.reduce(allTrueR, true); // false Copy
let vals = [ 1, true, {}, "hello world"];vals.reduce(allTrueR, true); // truevals.push(0);vals.reduce(allTrueR, true); // false
Reduce function that returns true if all of the values are truthy.
Example