I have two arrays. The first array contains some values while the second array contains indices of the values which should be removed from the first array. For example:
You could construct a Set from the array and then create an array from the set.
Set
const array = [1, 1, 2, 3, 5, 5, 1]; const uniqueArray = [...new Set(array)]; console.log(uniqueArray); // Result: [1, 2, 3, 5]