#A. Create an array names = %w[chris sandy josie billy suzie] #B. Find the length of the array and iterate through it names.length.times do |i| puts i.to_s + " " + names[i] end
How to iterate through an array in Ruby
Leave a Reply
You must be logged in to post a comment.