Your tests lacks some rules.For example:
My code:
function diffArray(arr1,arr2){
let arr=arr1.filter(b=>!arr2.includes(b))
return arr
}
passes the test while it is only checking symmetricity in first array not both.
Your code so far
function diffArray(arr1,arr2){
let arr=arr1.filter(b=>!arr2.includes(b))
return arr
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36
Yes. You are correct that this is not the behavior for the symmetric difference. There was an open GitHub issue on this, which was closed just 2 days ago. It looks like the changes haven’t yet been pushed to prod though.
You’re on the right track, here i see you’ve filtered only elements in array1 & not in array2, so suggest you apply the concat method & filter for array2 hope this helps!