Trouble with build a library

I dont know why but when ever i do, codecademy is always giving me a hassle with push methods. take this for example:
class Media{
constuctor(title){
this._title = title
this._isCheckedOut = false
this._ratings =
}
get title(){
return this._title
}
get isCheckedOut(){
return this._isCheckedOut
}
get ratings(){
return this._ratings
}
set isCheckedOut (value){
return this._isCheckedOut = value
}
toggleCheckOutStatus(){
this.isCheckedOut = !this.isCheckedOut
}
getAverageRating(){
let ratingSum = this.ratings.reduce((accumulator,rating)=>
accumulator + rating)
return ratingSum / this.ratings.length
}
addRating(value){
this._ratings.push(value)
}
}

when i try to call addRating with a value, the compiler will always return an error. Can someone help me figure this out?

3 things needed to be able to help you:

  • Better if you embed your code in a 24 block; preserves formatting
  • Include all your project’s code + highlight the parts where it’s going wrong
  • Include details of any error message you’re getting
2 Likes

Check your spelling. Oops! It is much easier to help you as @antonjw said if you format your code instead of just pasting it. See this post: How to ask good questions (and get good answers) Particularly the section called: Format Your Code
Happy Coding!

2 Likes