I want to know if I can chain two filters together? I’m not sure why this doesn’t work
function diffArray(arr1, arr2) {
var newArr = [];
var newArr2=[];
// Same, same; but different.
newArr=arr1.filter(el1=>!arr2.indexof(el1)>-1).filter(el2=>!arr1.indexof(el2)>-1);
console.log(newArr);
console.log(newArr2);
return newArr.concat(newArr2);
}
console.log(diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]));