Answers for "how to remove repeated elements in array list in java8"

1

completely remove duplicate element from the array

var array = [1, 2, 3, 4, 4, 5, 5],
    result = array.filter(function (v, _, a) {
        return a.indexOf(v) === a.lastIndexOf(v);
    });

console.log(result); // [1, 2, 3]
Posted by: Guest on March-29-2022
0

compare two lists and remove duplicates java

listA.removeAll(new HashSet(listB));
Posted by: Guest on February-21-2020

Code answers related to "how to remove repeated elements in array list in java8"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language