Hi…
I just finished the “MDN” assignment:
Can I get a evaluation of my work:
Hi…
I just finished the “MDN” assignment:
Can I get a evaluation of my work:
Hello @albaraa_1949
Here are my comments:
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?Shape
and calcPerimeter
from task 1. 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
I apologize for the delay in reading your reply…
I’ve made improvements, hope this is what I need to do.
Gratefully💚
No reason to apologize
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
In calcArea()
you squared this.sides
instead of this.sideLength
which gives the wrong result (16 instead of 25).
See you,
Michael
Wow, how did I not notice this…!
Thank you for all the valuable notes…