Answers for "remove duplicate and concat array in javascript es6"

7

javascript remove duplicate in two arrays

array1 = array1.filter(function(val) {
  return array2.indexOf(val) == -1;
});
// Or, with the availability of ES6:

array1 = array1.filter(val => !array2.includes(val));
Posted by: Guest on April-27-2020
0

compare two arrays and remove duplicates javascript

array1 = array1.filter(function(val) {
  return array2.indexOf(val) == -1;
});
Posted by: Guest on September-08-2021

Code answers related to "remove duplicate and concat array in javascript es6"

Code answers related to "Javascript"

Browse Popular Code Answers by Language