Can I get a evaluation

Hi… :wave:t2:

I just finished the “MDN” assignment:

Can I get a evaluation of my work:

https://codepen.io/someone_49/pen/gOGdLRN?editors=0010

Hello @albaraa_1949

Here are my comments:

  • Task 1: There’s no need for a if..else inside the calcPerimeter method. You didn’t set the sides parameter when instantiating. When you set it you will have all the necessary information through the constructor (name, sides, sideLength) to use a single console.log(). Can you find out how to do it?
  • Task 2: You correctly transformed Shape and calcPerimeter from task 1. :white_check_mark:
  • Task 3: Your constructor isn’t quite right. Instead of setting this.name and this.sides while filling bogus values into the super() call, you should put does values ('square' and 4) directly into the super() call. Do you know what I mean?

I hope that helps. Feel free to ask me if my hints weren’t clear enough.

Happy coding,
Michael

1 Like

I apologize for the delay in reading your reply…

I’ve made improvements, hope this is what I need to do.

Gratefully💚

1 Like

No reason to apologize :slightly_smiling_face:

You replaced one conditional (if..else) with another (ternary operator). What I meant is that you can directly use ${this.name} in the console output:

`the perimeter of my ${this.name} is : [${ this.sideLength * this.sides }].`

That’s the reason we have a “name” parameter in the constructor. Looks easier, right?

Your updated constructor in task 3 is exactly what I meant :+1:
In calcArea() you squared this.sides instead of this.sideLength which gives the wrong result (16 instead of 25).

See you,
Michael

1 Like

Wow, how did I not notice this…!

Thank you for all the valuable notes…:rose:

1 Like