What would be a nice elegant functional solution for anding two boolean arrays in ES6?
const a1 = [true, false, false] const a2 = [true, true, false]
Use can use Array#map to iterate the 1st array, and get the value of the 2nd array using the index (the 2nd param in the callback):
const a1 = [true, false, false] const a2 = [true, true, false] const result = a1.map((b, i) => b && a2[i]); console.log(result);