I learned today a quick way to test a bunch of boolean expressions in Javascript is to put them in an array and use Javascript's some
or every
method:
arr.some(Boolean)
arr.every(Boolean)
.some(Boolean)
will return true if any element of the array is truthy. .every(Boolean)
will return true if all elements in the array are truthy.