function copyByIndex(arr, index_arr) {
  const result = [];
  forEach(index_arr, function(index) {
    result.push(arr[index]);
  });
  return result;
}
Returns a new array of elements from arr, based on the indexes of elements
provided by index_arr. For example, the result of index copying
['a', 'b', 'c'] with index_arr [1,0,0,2] is ['b', 'a', 'a', 'c'].

@param {!IArrayLike<T>} arr The array to get a indexed copy from.
@param {!IArrayLike<number>} index_arr An array of indexes to get from arr.
@return {!Array<T>} A new array of elements from arr in index_arr order.
@template T