Challenge: Solution Review
This lesson will explain the solution to the problem from the previous coding challenge.
We'll cover the following...
We'll cover the following...
Solution #
Explanation
This challenge involved a music library containing different genres of music such as Rock, Pop, and Country. Your task was to implement the visitor pattern to perform the additional operation of creating a separate playlist for the Rock music in the library. We will look into how that is done later on.
Let’s start by discussing the Song class below:
class Song{
constructor(name,genre){
this.name = name
this.genre = genre
}
getName(){
return this.name
}
getGenre(){
return this.genre
}
}
A Song has the following properties:
-
A ...