let str1 = '000111';
let str2 = str1.match(/.{1,1}/g);
console.log(str2); ==> ["0", "0", "0", "1", "1", "1"]
let str3 = '111111';
let str4 = str3.match(/.{1,1}/g);
console.log(str4); ==> ["1", "1", "1", "1", "1", "1"]
function zip(arrays) {
return Array.apply(null,Array(arrays[0].length)).map(function(_,i){
return arrays.map(function(array){return array[i]})
});
}
console.log(zip([str2, str4])); ==> [["0", "1"], ["0", "1"], ["0", "1"], ["1", "1"], ["1", "1"], ["1", "1"]]
bb = zip([str2, str4]).map(function(obj){ return (obj[0] != obj[1]); })
console.log(bb); ==> [true, true, true, false, false, false]