-
Notifications
You must be signed in to change notification settings - Fork 206
Tasks completed #171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Tasks completed #171
Conversation
devmentor-pl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arturze,
Bardzo dobrze sobie poradziłeś! 👍
Zostawiłem drobne uwagi w komentarzach :)
| console.log( | ||
| addition, | ||
| substraction, | ||
| multiplication, | ||
| division, | ||
| modulo, | ||
| increment, | ||
| decrement | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Można było dodać wyniki działań do tablicy i wykorzystać pętlę do porównywania - byłoby ładnie ;P
| } | ||
|
|
||
| /* rozwiązanie z pętlą while */ | ||
| console.log(resultMethod + ' = ' + result); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
| if (a <= b && a <= c) { | ||
| return b + c; | ||
| } else if (b < a && b <= c) { | ||
| return a + c; | ||
| } else { | ||
| return a + b; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tutaj również można wykorzystać tablicę - posortować i wybrać dwie pierwsze/ostatnie ;)
| console.log('Average value: ' + avg); | ||
|
|
||
| function getAvg(arr) { | ||
| return arr.reduce((a, b) => a + b) / arr.length; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Warto pamiętać o drugim parametrze tj. reduce(() => {}, 0) - wtedy pusta tablica nie powoduje błędu
| artur.addGrade('physics', 5); | ||
|
|
||
| console.log(artur.getAverageGrade('maths')); | ||
| console.log(artur.getAverageGrade()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
No description provided.