const arr1 = ['x','y'];
const arr2 = ['y','z'];
const arr3 = ['x', 'z'];
const arr4 =['x','y','z','c'];
const newarr = [].concat(arr1, arr2, arr3, arr4);
let result = {};
for (let elem of newarr) {
if (result[elem] === undefined) {
result[elem] = 1;
} else {
result[elem]++;
}
}
console.log(result);