Использовать фильтр массива для удаленных повторяющихся значений
const array = ["test", "test1", "test2", "test", "test", "test1", "test", "test2", "test"];
var uniqueArray = array.filter(function(elem, index, self) {
return index === self.indexOf(elem);
})
console.log(uniqueArray);