Hi there. I have a question about OOJS 2 task. Everyone here uses super() in class Square extends Shape like this:
constructor (sideLength) {
super(‘square’, 4, sideLength);
}
But I cannot understand clearly if I can use this one:
constructor (sideLength) {
super();
this.name = ‘square’;
this.sides = 4;
this.sideLength = sideLength;
}
I would be very grateful if someone could explain the difference of these cases, and why better to use the first one if it is so.
Thanks in advance.