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:
filter + indexOf (IE9+):
function removeMany(array, indexes) { return array.filter(function(_, idx) { return indexes.indexOf(idx) === -1; }); });
Or with ES6 filter + find (Edge+):
function removeMany(array, indexes = []) { return array.filter((_, idx) => indexes.indexOf(idx) === -1) }