Question: Javascript You will be creating a custom object called catalogObject that will serve as a container for all of the song catalog functionality. This object

Javascript

You will be creating a custom object called catalogObject that will serve as a container for all of the song catalog functionality. This object will include catalog properties and methods. We will incrementally add and test functionality. Initially, we'll declare the catalogObject, declare an array property _songs initialized to an empty array, add method addSong(props) to add a song to _songs, and method listSongs() to list all of the songs in _songs:

  • _songs: empty array property
  • addSongs(props): Add a song to _songs, where method parameter props, short for properties, is a song object. The addSongs() method must use the String trim() (Links to an external site.) method to ensure the song title has no leading or trailing white space.
  • listSongs(): Iterates through _songs array and lists out the songs. You must use a template literal (Links to an external site.) to output the songs to the Console. Template literals make formatting multi-variable output easier.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!