Is it possible to loop through a result set in the order as given but only print out the index in reverse? Example:
items = ["a", "b", "c"]
items.each_with_index do |value, index|
puts index.to_s + ": " + value
end
Gives:
0: a
1: b
2: c
Is there a way to reverse only the index so that the output is:
2: a
1: b
0: c
items = ["a", "b", "c"](array[], not hash{})