I am fairly new to Ruby. I am attempting this challenge and got stuck.
Given the following arrays:
titles = ['Name', 'Address', 'Description']
data = [['Reddit', 'www.reddit.com', 'the frontpage of the internet'],
['Wikipedia', 'en.wikipedia.net', 'The Free Encyclopedia'],
['xkcd', 'xkcd.com', 'Sudo make me a sandwich.']]
For now, I would like to print something like this:
Name: Reddit, Wikipedia, xkcd
Address: www.reddit.com, en.wikipedia.net, xkcd.com
Description: the frontpage of the internet, The Free Encyclopedia, Sudo make me a sandwich.
As far as my limited knowledge goes, I have attempted
titles.each { |title| print title } but I cannot follow up accessing its respective elements from another array in a methodical way. Is .each sufficient for this problem?