function diffArray(arr1, arr2) {
var newArr = [];
for (let item of arr1) {
if (arr2.includes(item) === false) {
newArray.push(item);
}
}
for (let item of arr2) {
if (arr1.includes(item) === false) {
newArr.push(item);
}
}
return newArr;
}
diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]);
I’ve copy and pasted all the input and all of it returns the correct output. Why is this not passing?
Thanks in advance!