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