main.rb105 chars6 lines
This will iterate over the strings
array and use the map
function to create a new array containing each string with its corresponding index. The with_index
method is used to pass the index as an argument to the block. The output would be an array with the following elements:
main.rb46 chars6 lines
gistlibby LogSnag