I have an array and I have an array with indexes of certain elements from the first array. What is the best way to get the elements from the first array?
I am doing:
result = []
indexes.each { |current| result << my_array[current] }
But there should be a better way..