Tell us what’s happening:
I tested all of the steps offered and got the same return output as the supposed outputs. I am a little confused as to what is causing the lesson from completing since it is returning the correct outputs.
Your code so far
function diffArray(array1, array2) {
let filtered = array1.filter((thing) => array2.indexOf(thing) !== -1);
let final = [...array1, ...array2];
for(let i = 0; i<filtered.length;i++){
while(final.indexOf(filtered[i])!==-1){
final.splice(final.indexOf(filtered[i]), 1);
}
}
return filtered;
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36 OPR/134.0.0.0
Challenge Information:
Build a Symmetric Difference Function - Build a Symmetric Difference Function