Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

diff two arrays javascript

function diffArray(arr1, arr2) {
  return arr1
    .concat(arr2)
    .filter(item => !arr1.includes(item) || !arr2.includes(item));
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #diff #arrays #javascript
ADD COMMENT
Topic
Name
1+7 =