# Revisión OOJS

**URL:** <https://discourse.mozilla.org/t/revision-oojs/89396>\
**Category:** Learn\
**Created:** [November 26, 2021, 5:40pm UTC](https://discourse.mozilla.org/t/revision-oojs/89396 "2021-11-26T17:40:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Takis](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/takis/32/51892_2.png) [@Takis](https://discourse.mozilla.org/u/Takis)\
**Post date:** [November 26, 2021, 5:40pm UTC](https://discourse.mozilla.org/t/revision-oojs/89396/1 "2021-11-26T17:40:43Z")

</div>

[Further exercises]–\> [Classes in JavaScript - Learn web development | MDN](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Object-oriented_JS)

the part of the number of elements interests in array I did it all in a loop, instead of separating 1, 2 and then 3 ++ doing it in a loop.

it’s okay?

See the Pen [JavaScript orientado a objetos para principiantes 1.0](https://codepen.io/ltakisl/pen/qBXvobz) by lTakisl ([@ltakisl](https://codepen.io/ltakisl)) on [CodePen](https://codepen.io).

and

> **[Test your skills: Object-oriented JavaScript - Learn web development | MDN](https://developer.mozilla.org/en-US/docs/Learn_web_development/Extensions/Advanced_JavaScript_objects/Test_your_skills:_Object-oriented_JavaScript)**
>
> The aim of this skill test is to assess whether you've understood our Classes in JavaScript article.

See the Pen [OOJS 1](https://codepen.io/ltakisl/pen/jOLgpVP) by lTakisl ([@ltakisl](https://codepen.io/ltakisl)) on [CodePen](https://codepen.io).

See the Pen [OOJS 2](https://codepen.io/ltakisl/pen/mdMNGEy) by lTakisl ([@ltakisl](https://codepen.io/ltakisl)) on [CodePen](https://codepen.io).

See the Pen [OOJS 3](https://codepen.io/ltakisl/pen/QWMeVZQ) by lTakisl ([@ltakisl](https://codepen.io/ltakisl)) on [CodePen](https://codepen.io).

---

<div class="post-metadata">

**Author:** ![justsomeone](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/justsomeone/32/67787_2.png) [@justsomeone](https://discourse.mozilla.org/u/justsomeone)\
**Post date:** [November 27, 2021, 3:13pm UTC](https://discourse.mozilla.org/t/revision-oojs/89396/2 "2021-11-27T15:13:04Z")

</div>

Hello @Takis

you doing great well done

for the further excersice there many way to do it and it’s fine to use your loop but you lost some of the readability of the code specially in the case when there only 2 elements it make me read the case of 2 then for next iteration it will use the first if which could be easier if you used the way in solutions also the solution has better performance i know it so little but as long as your code get bigger even little enhancement would help  
in the solution it just write the result for the case of 2 element but for your case you need to loop twice

for

1. the Perimeter calcPerimeter method change the sides value beside calculated the perimeters you should not change the sides value

2. same issue as 1 and you did not call the calcPerimeter method

3. same issue as 1

hope that help and have a nice day 🙂

---

<div class="post-metadata">

**Author:** ![Takis](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/takis/32/51892_2.png) [@Takis](https://discourse.mozilla.org/u/Takis)\
**Post date:** [November 27, 2021, 5:29pm UTC](https://discourse.mozilla.org/t/revision-oojs/89396/3 "2021-11-27T17:29:15Z")

</div>

> [@justsomeone](#):
>
> - the Perimeter calcPerimeter method change the sides value beside calculated the perimeters you should not change the sides value

With the google translation I don’t know what you meant, I didn’t understand you very well, but I modified the

> this.sides = \* this.sideLength

to

> this.sides \* this.sideLength

it was that? and I added what was missing I think, tell me if it is correct now 🙂

---

<div class="post-metadata">

**Author:** ![justsomeone](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/justsomeone/32/67787_2.png) [@justsomeone](https://discourse.mozilla.org/u/justsomeone)\
**Post date:** [November 27, 2021, 5:34pm UTC](https://discourse.mozilla.org/t/revision-oojs/89396/4 "2021-11-27T17:34:07Z")

</div>

that exactly what i mean well done 🙂

---

<div class="post-metadata">

**Author:** ![Takis](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/takis/32/51892_2.png) [@Takis](https://discourse.mozilla.org/u/Takis)\
**Post date:** [November 27, 2021, 5:35pm UTC](https://discourse.mozilla.org/t/revision-oojs/89396/5 "2021-11-27T17:35:43Z")

</div>

😀 😉 👍
