ARTICLE AD BOX
I was trying to come up with a clean way to check lots of booleans and write this thing:
//first make an array of the conditions you're checking const arr = [true,true,false,true]; //then use .reduce to check all elements let test = arr.reduce((acc, curr) => (curr && total ? true : false), true); console.log(test)But is this good? Would it work efficiently with more conditions?
