Build a library project. Catalog class

Hi there.

Task description:

Create class called Catalog that holds all of the Media items in our library.

I am trying to deal with the Catalog class task but I do not understand how this should be a class, since a class is a template for an object. How can a class “hold” the items in the library.
One way I am thinking about this is to have an array named “Catalog” to hold all the items (as references).
See the code below:

class Media { constructor(title){ this._title = title; this._isCheckedOut = false; this._rating = []; } get title(){ return this._title; } get isCheckedOut(){ return this._isCheckedOut; } get rating(){ return this._rating; } toggleCheckOutStatus(){ this._isCheckedOut = !this._isCheckedOut; } getAverageRating(){ if (this._rating.length != 0){ return ((this._rating.reduce((acc, cur) => acc+cur,0))/this._rating.length).toFixed(2); ; } } addRating(newRating){ if(typeof(newRating) == 'number' && newRating >= 0){ if (newRating > 0 && newRating < 6){ this._rating.push(newRating); } else { console.log("The Rating must be between 1 and 5!", newRating); } } else { console.log("Rating input is not a number"); } } } class Book extends Media { constructor(author, title, pages){ super(title); this._author = author; this._pages = pages; } get author(){ return this._author; } get pages(){ return this._pages; } } class Movie extends Media { constructor(director, title, runTime){ super(title); this._director = director; this._runTime = runTime; } get director(){ return this._director; } get runTime(){ return this._runTime; } } class CD extends Media { constructor(title, artist, year){ super(title); this._artist = artist; if (typeof year == 'number' && year.toString().length == 4){ this._year = year; } else { console.log("Year shoud be number of 4 characters. Re-assign year.", year, typeof(year)); } this._songs = []; } get artist(){ return this._artist; } get year(){ return this._year; } get songs(){ return this._songs; } setSongs(newSongs){ this._songs = newSongs; } howOld(){ const todaysYear = new Date().getFullYear(); return todaysYear-this._year; } suffleSongs(){ const array = this._songs; for (let i = array.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)); const temp = array[i]; array[i] = array[j]; array[j] = temp; } //Used Fisher-Yates algorith. return array; } } let Catalog = []; const historyOfEverything = new Book('Bill Bryson', 'A Short History of Nearly Everything',544); Catalog.push(historyOfEverything); const speed = new Movie('Jan de Bont','Speed', 116); // Catalog.push(speed); const thisIsMusic = new CD("NOW That's What I Call Music! 103", 'Various Artists', 2019); // Catalog.push(thisIsMusic); console.log(Catalog); historyOfEverything.addRating(1); historyOfEverything.addRating(5); historyOfEverything.addRating(5); console.log(Catalog);

Let me know if there is any ‘smarter’ way. Thank you!

Regards,
Bogdan.