What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-26 15:43:02
javascript remove duplicate in two arrays
// 1. filter() function removeDuplicates(array) { return array.filter((a, b) => array.indexOf(a) === b) }; // 2. forEach() function removeDuplicates(array) { let x = {}; array.forEach(function(i) { if(!x[i]) { x[i] = true } }) r... Add solution