Super() Syntax Error


I have used the super() function before and it has worked perfectly, but now I’m suddenly getting a syntax error that makes no sense. I’m pretty sure I spelled everything right and I looked back into the lesson and the syntax seems right.

class Media{
    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(newVal){
    this._isCheckedOut = newVal
    this._isCheckedOut === !this._isCheckedOut
    let ratingSum = this.ratings.reduce((currentSum, rating) => currentSum + rating, 0)
    let lenOfRatings = ratings.length
    return ratingSum / lenOfRatings

class Book extends Media{
  constuctor(title, author, pages){
    this._author = author
    this._pages = pages
  get author(){
    return this._author
  get pages(){
    return this._pages

class Movie extends Media{
  constuctor(title, runTime){
    this._runTime = runTime
  get runTime(){
    return this._runTime


What is the syntax error saying?

    this._title = super(title);
SyntaxError: 'super' keyword unexpected here
    at createScript (vm.js:53:10)
    at Object.runInThisContext (vm.js:95:10)
    at Module._compile (module.js:543:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:427:7)
    at startup (bootstrap_node.js:151:9)

Weird right?


That’s not really the error, though. Just what got flagged because it is unexpected. The real error is the misspelling above it.

The same spelling error occurs in all three classes.


Omfg :joy::joy::joy: I cannot believe I missed that. Lets pretend this never happened :zipper_mouth_face: