Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

compare two arrays and return the difference javascript

let difference = arr1
                 .filter(x => !arr2.includes(x))
                 .concat(arr2.filter(x => !arr1.includes(x)));
Source by techiedelight.com #
 
PREVIOUS NEXT
Tagged: #compare #arrays #return #difference #javascript
ADD COMMENT
Topic
Name
3+6 =