File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
1-js/02-first-steps/12-while-for/3-which-value-for Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 1- ** The answer: from ` 0 ` to ` 4 ` in both cases .**
1+ ** Atsakymas: nuo ` 0 ` iki ` 4 ` abiem atvejais .**
22
33``` js run
44for (let i = 0 ; i < 5 ; ++ i) alert ( i );
55
66for (let i = 0 ; i < 5 ; i++ ) alert ( i );
77```
88
9- That can be easily deducted from the algorithm of ` for ` :
9+ Tai galima labai lengvai nustatyti iš ` for ` algoritmo :
1010
11- 1 . Execute once ` i = 0 ` before everything (begin ).
12- 2 . Check the condition ` i < 5 `
13- 3 . If ` true ` -- execute the loop body ` alert(i) ` , and then ` i++ `
11+ 1 . Įvykdyti vieną kartą ` i = 0 ` prieš visa kita (pradžia ).
12+ 2 . Patikrinti sąlygą ` i < 5 `
13+ 3 . Jeigu ` true ` -- įvykdyti ciklo korpusą ` alert(i) ` , o tada ` i++ `
1414
15- The increment ` i++ ` is separated from the condition check (2). That's just another statement .
15+ Padidėjimas ` i++ ` yra atskirtas nuo sąlygos patikrinimo (2). Tai tik dar vienas teiginys .
1616
17- The value returned by the increment is not used here, so there's no difference between ` i++ ` and ` ++i ` .
17+ Vertė grąžinta padidėjimo nėra čia naudojama, tad nėra jokio skirtumo tarp ` i++ ` ir ` ++i ` .
You can’t perform that action at this time.
0 commit comments