Answers for "completely remove duplicate element from the array"

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

Code answers related to "completely remove duplicate element from the array"

Browse Popular Code Answers by Language