Concatenate an array

Hi all,

I have a really hard time finding the right solution for the following question:

How would you write in Ruby the necessary code to Concatenate an array [“Dog”,"Cat, “Bird”] with the respective index? ex “1-Dog” , “2-Cat”

I’m a very beginner who just finished the basic Ruby course on Codecademy. Can anyone help with this peace of code?

Many thanks!

Look up the ruby array method ‘each with index’

1 Like

Just a quick note - I’ve moved this into the #get-help:Ruby section. :slight_smile:

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.