Skip to content

lopps exercises#130

Open
Sebpie0203 wants to merge 3 commits intodevmentor-pl:masterfrom
Sebpie0203:master
Open

lopps exercises#130
Sebpie0203 wants to merge 3 commits intodevmentor-pl:masterfrom
Sebpie0203:master

Conversation

@Sebpie0203
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown
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.

Sebastianie,

Musisz jeszcze poćwiczyć warunki i zależności związane z samą pętlą for - zostawiłem parę uwag i czekam na zadanie 03 ;)

01/app.js Outdated
Comment on lines +4 to +6
for (let i = 5; i < randomNumber; i++) {
console.log(i);
}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Ta część ma się pojawić tylko wtedy, kiedy warunek poniżej jest nieprawidłowy.
Dlatego powinna pojawić się ona w else tj.

if(...) {
     ...
} else {
   for(...)
}

02/app.js Outdated
let result = 0;

for (let i = 0; i < x; i++) {
if(x < result) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Czy faktycznie ten raunek jest tutaj potrzebny? Sam w sobie for m warunek, który zatrzymuje pętle.

02/app.js Outdated
if(x < result) {
x = x + result
}
console.log(result);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Wyświetlenie wyniku powinno być poza pętlą.

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