Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Databases

Authors: Ian Robinson, Jim Webber, Emil Eifrem

1st Edition

1449356265, 978-1449356262

More Books

Students also viewed these Databases questions