What is the easiest way to convert
[x1, x2, x3, ... , xN]
to
[[x1, 2], [x2, 3], [x3, 4], ... , [xN, N+1]]
In ruby 1.9.3 there is a chainable method called with_index which can be chained to map.
with_index
For example:
array.map.with_index { |item, index| ... }