Returns a version of the array that has been reordered by the given list of indices.
The string version likewise returns a reordered string.
With arrays, the length of the resulting array is the same as the length of the index list. Negative numbers in the index list will read from the end of the array. Out of bound values will insert zeros, but this should be considered an error.
With strings, the length of the resulting array may be less than the length of the index list. Each index retrieves a character, not a byte, from the source string. The result is thus a UTF-8 encoded string.