get the index of an array in a for loop ruby code example
Example: ruby loop each with index
X.each_with_index do |item, index|
puts "current_index: #{index}"
end
X.each_with_index do |item, index|
puts "current_index: #{index}"
end