array.each_with_index do |item, i| p [i, item] end