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:
Not in-place but can be done using grep and inArray functions of jQuery.
in-place
grep
inArray
jQuery
var arr = $.grep(valuesArr, function(n, i) { return $.inArray(i, removeValFromIndex) ==-1; }); alert(arr);//arr contains V2, V4
check this fiddle.