-
Notifications
You must be signed in to change notification settings - Fork 206
practice-js-basics done #166
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?
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.
Michale,
Zadania są ok 👍
Zostawiłem Ci parę uwag, na spotkaniu wszystko dokładnie umówimy :)
| } | ||
|
|
||
| console.log(); | ||
| console.log(); |
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.
👍
02/app.js
Outdated
|
|
||
| while (j <= n) { | ||
| if (a <= 9 && a > 0 && n <= 9 && n > 0) { | ||
| result2 = Math.pow(a, n); |
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.
Trochę inaczej miało się to wyświetlać w konsoli :)
| } | ||
| } | ||
|
|
||
| showInfo(sum, even); |
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.
👍
| sum += num; | ||
|
|
||
| }); | ||
| return sum / 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 się zabezpieczyć czy nie dzielimy przez 0 :)
05/app.js
Outdated
| for (let i = 0; i < grades.length; i++) { | ||
| sum += grades[i]; | ||
| } | ||
| console.log(sum / grades.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.
Tutaj powinno być return, bo funkcja powinna zwrócić wynik (zaczyna się od get)
05/app.js
Outdated
| } | ||
| if (totalCount === 0) return null; | ||
|
|
||
| console.log((totalSum / totalCount).toFixed(2)); |
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.
Podobnie jak wcześniej
| for (let subjectName in this.grades) { | ||
| const subjectGrades = this.grades[subjectName]; | ||
|
|
||
| for (let i = 0; i < subjectGrades.length; i++) { |
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.
To jest to oczym pisałem na Slacku. Pobieramy konkretny przedmiot oraz oceny dla niego. Sumujemy i pobieramy oceny dla kolejnego - w ten sposób mamy dostęp do wszystkich ocen (a w zasadzie ich sumy) i możęmy obliczyć średnią.
No description provided.