File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
1-js/02-first-steps/12-while-for/1-loop-last-value 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 : ` 1 ` .
1+ Atsakymas : ` 1 ` .
22
33``` js run
44let i = 3 ;
@@ -8,18 +8,18 @@ while (i) {
88}
99```
1010
11- Every loop iteration decreases ` i ` by ` 1 ` . The check ` while(i) ` stops the loop when ` i = 0 ` .
11+ Kiekviena ciklo iteracija sumažina ` i ` per ` 1 ` . Patikrinimas ` while(i) ` sustabdo ciklą kai ` i = 0 ` .
1212
13- Hence, the steps of the loop form the following sequence ("loop unrolled "):
13+ Dėl to žingsniai iš paskutinio ciklo suformuoja tokią seką ("atskleistas ciklas "):
1414
1515``` js
1616let i = 3 ;
1717
18- alert (i-- ); // shows 3, decreases i to 2
18+ alert (i-- ); // parodo 3, sumažina i iki 2
1919
20- alert (i-- ) // shows 2, decreases i to 1
20+ alert (i-- ) // parodo 2, sumažina i iki 1
2121
22- alert (i-- ) // shows 1, decreases i to 0
22+ alert (i-- ) // parodo 1, sumažina i iki 0
2323
24- // done , while(i) check stops the loop
24+ // viskas , while(i) patikrinimas sustabdo ciklą
2525```
You can’t perform that action at this time.
0 commit comments