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 try and use delete array[index] This won't completely remove the element but rather sets the value to undefined.
delete array[index]
undefined