Build a Library

my code :

class Media {
  constructor(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(checkedOut){
    this._isCheckedOut = checkedOut;
  }
  toggleCheckOutStatus(){
   this.isCheckedOut= !this.isCheckedOut;
     
   }

  getAverageRating(){
    let ratingsSum = this.ratings.reduce((currentSum, rating) => currentSum + rating);
    return ratingsSum/this.ratings.length;
  }
  addRating(newRating){
    this.ratings.push(newRating)
  }
}
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;
  }
}
const historyOfEverything = new Book('Bill Bryson','A Short History of Nearly Everything',544) 
historyOfEverything.toggleCheckOutStatus;
console.log(historyOfEverything.isCheckedOut);
historyOfEverything.addRating(4);
historyOfEverything.addRating(5);
historyOfEverything.addRating(5);
console.log(historyOfEverything.getAverageRating);

const speed = new Movie('Jan de Bont','Speed',116);
speed.toggleCheckOutStatus;
console.log(speed.isCheckedOut);
speed.addRating(1);
speed.addRating(1);
speed.addRating(5);
console.log(speed.getAverageRating);

and for some reasons, thats what i`m getting :

false
[Function: getAverageRating]
false
[Function: getAverageRating]

what`s wrong with my code?

https://www.codecademy.com/courses/introduction-to-javascript/projects/build-a-library

The line above is accessing the method by reference only, when it should be invoking it.

object.foo      // reference
object.foo()    // invoke

console.log(historyOfEverything.getAverageRating);
console.log(speed.getAverageRating)

shouldn’t getAverageRating be invoked with () as last poster suggested? For example:

console.log(historyOfEverything.getAverageRating());

console.log(speed.getAverageRating())

oh ,yes.that’s right .thanks.
any idea why this doesnt work?

historyOfEverything.toggleCheckOutStatus;
console.log(historyOfEverything.isCheckedOut);
speed.toggleCheckOutStatus;
console.log(speed.isCheckedOut);

it should return “true”

Missing ()

Likewise.