I am using Array() with each_with_index to output a array with index but I want it to output
[[0,obj1],[1,obj2]....]
whereas each_with_index makes it output
[[obj1,0],[obj2,1]....]
Is there anyway this can be fixed easilly?
As been asked to show code.
Array(test.each_with_index)
Try adding
.map { |x| x.reverse }after theeach_with_index.