function difference (arr1, arr2) {
var combinedArr = arr1.concat(arr2);
combinedArr = combinedArr.flat();
var newStr = '';
for(var i=0; i<combinedArr.length; i++) {
}
return combinedArr;
}
console.log(difference([1, 2, 3], [100, 2, 1, 10]));
//["1", "2", "3", "10", "100"]
I flattened this array and combined it. Now i'm trying to remove duplicates but I don't know the best way how. I was tinkering with the filter () method and drying to remove like items but I can't figure it out. Any help?