Tell us what’s happening:
i don’t understand how can i pass 6 and 7 test
Your code so far
const diffArray= (arr1,arr2)=>{
if (arr1.length >= arr2.length){
return arr1.filter((element)=> !arr2.includes(element))
} else {
return arr2.filter((element)=> !arr1.includes(element))
}
}
console.log(diffArray(["pen", "book"], ["book", "pencil", "notebook"]))
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36
Challenge Information:
Build a Symmetric Difference Function - Build a Symmetric Difference Function