Answers for "remove duplicates if occured together string nodejs"

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

remove duplicate values from string in javascript

const names = ['John', 'Paul', 'George', 'Ringo', 'John'];

let unique = [...new Set(names)];
console.log(unique);
Posted by: Guest on February-17-2022

Code answers related to "remove duplicates if occured together string nodejs"

Code answers related to "Javascript"

Browse Popular Code Answers by Language