Assessment wanted for OOJS 2 skill test - ReferenceError

Hi!

I need help with the OOJS skill test #2:

class Shape {

  name;
  sides;
  sideLength;

  constructor(name, sides, sideLength) {
    this.name = name;
    this.sides = sides;
    this.sideLength = sideLength;
    }

  calcPerimeter() {
    console.log(this.sides*this.sideLength);
    }
}

class Square extends Shape {

  constructor(sideLength) {
    super(name) = 'square';
    super(sides) = 4;
    this.sideLength = sideLength;
  }

  calcArea() {    
   
 console.log(this.sideLength*this.sideLength);
  }
}

const square = new Square();

I get an “ReferenceError: Invalid left-hand side in assignment” Error. I just need help with this error, should anything else in my code be wrong, please let me figure it out myself.
Thanks in advance!
Leopold

Hi @andrae and welcome to the community :wave:

Sorry for the long delay. I don’t know if you have already figured it out, but here’s the explanation for your error:
super() is a function call that calls the parent’s constructor and you can’t assign a value to a function call. Instead you need to put the desired values directly as parameters of it.

Please let me now if you need further assistance. :slightly_smiling_face:

Have a nice day,
Michael

Try this:

super(‘square’, 4, length);

for

constructor(sideLength) {
super(name) = ‘square’;
** super(sides) = 4;**
this.sideLength = sideLength;
}