Given an array arr and an array of indices ind, I\'d like to rearrange arr in-place to satisfy the given indices. For exa
arr
ind
Try this:
var result = new Array(5); for (int i = 0; i < result.length; i++) { result[i] = arr[ind[i]]; } console.log(arr);