Skip to content

Conversation

@Dariadaria01
Copy link

No description provided.

Copy link
Owner

@devmentor-pl devmentor-pl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dario,

Całość wygląda bardzo dobrze 👍
Zostawiłem Ci dodatkowe działanie dla zadanie 05 :)

Comment on lines +10 to +15
const suma = numA + b;
const roznica = numA - b;
const iloczyn = numA * b;
const iloraz = numA / b;
const modulo = numA % b;
const potega = numA ** b;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nazwy zmiennych zdecydowanie lepiej jest pisać w j. angielskim

}
} else {
alert('Podałeś dane poza zakresem!');
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +11 to +13
a = Math.floor(Number(a));
b = Math.floor(Number(b));
c = Math.floor(Number(c));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Można też utworzyć tablicę, posortować i mamy 2 największe liczby troszkę prościej :)

if (arr.length === 0) return 0;
const sum = arr.reduce((acc, num) => acc + num, 0);
return sum / arr.length;
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

05/index.js Outdated
Comment on lines 29 to 32
const sum = grades.reduce(function (acc, curr) {
return acc + curr;
}, 0);
return sum / grades.length;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ta część jest bardzo podobna do części z linii 39-43 - w takim wypadku warto zrobić metodę (funkcje) i w obu miejscach wykorzystać, spróbujesz?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants