kz363/phase_0_unit_2

Reviewing Playlist.

Opened this issue · 0 comments

Love your code looks at lot like mind. I thought I would let you know about something I learned this week. You can take out the songs.each in your initialize method if you set the empty @playlist variable to an array of infinite songs arguments or *songs. I thought it was super cool hope you do to.

class Playlist
def initialize(_songs)
@playlist = [_songs] #I added *songs to your empty array.
#songs.each {|song| @playlist<<song} #can take this out if you use *songs above.
end