Build A Library JS Project

Hey guys,

I’m currently working on the build a library project and I can’t seem to find my error upon working out step 6. We are instructed to create a method beneath our getters inside the ‘Class Media’ but for some reason the method I am codifying is being registered as a key instead of a method. It comes out with a teal coloration which signifies a “key:value” pair instead of red. I’ve not been able to locate the source of my error. Hope someone can help!

See code inserted below for reference.

class Media { constructor(title) { this._title = title; this._isCheckedOut = true; this._ratings = 100; } get title() { return this._title; } get isCheckedOut() { return this._isCheckedOut; } get ratings() { return this._ratings; } set isCheckedOut(boolean) { this._isCheckedOut = boolean; } toggleCheckOutStatus() { } }; class Book extends Media { constructor(author,pages) { super(title); this._author = author; this._pages = pages; } } class Movie extends Media { constructor(director,runTime) { super(title); this._director = director; this._pages = pages; } } class CD extends Media { constructor(artist,songs) { super(title); this._artist = artist; this._songs = songs; } }

If you hover over the method signature in the Codebyte above, the linter recognizes this as a method. Finish the code and see if any errors are thrown.

Is the syntax highlight color the same in the LE?

I see, that’s interesting. Is there any particular reason why the program might be responding in that manner. The hint part of the step is showing the method in red. Maybe that’s just for reference but it really confused me.

Still not sure if you are referring to the LE or the Codebyte. Which is it?

The excercise itself, in the hint section of the step.

I have no firsthand knowledge of the behind the scenes workings of the LE. See if you can complete the code and get it to run, as expected. If there are errors, they should start to surface.

Thank you, so far it is running correctly. I’ll return if something crops up.

1 Like