Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

return symmetric difference of the array javascript

function symmetricDiff(arrary1, array2){
 let symmetricDifference = []; 
  
 symmetricDifference = array1.filter(element => !array2.includes(element))
   .concat(array2.filter(element => !array1.includes(element)))
 return symmetricDifference;
}
 
PREVIOUS NEXT
Tagged: #return #symmetric #difference #array #javascript
ADD COMMENT
Topic
Name
5+7 =