add version of Array.prune with indices