This is a two-part challenge.
Part One:
- Create an array called
favorite_movies
that holds your ten favorite movies (Each movie should be a string). - Iterate over the array using
.each
to print out#{movie} is one of my favorites!
- Return the number of items in the array.
- Return the first item in the array
- Return the last item in the array
Part Two:
- Create a hash called
favorite_music
where the key is the title of the song, and the value is the song’s artist. Make sure your hash has at least five key-value pairs. - Iterate through the hash to return a string for each key value pair that reads
I love #{song} by #{artist}!
- Return the number of key-value pairs in your hash.
View Today's Code Challenge! on Learn.co and start learning to code for free.