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:
Here is one that I use when not going with lodash/underscore:
while(IndexesToBeRemoved.length) { elements.splice(IndexesToBeRemoved.pop(), 1); }