Skip to content

Commit 4442b7e

Browse files
authored
Translated solution.md
1 parent 6b23c7f commit 4442b7e

File tree

1 file changed

+7
-7
lines changed
  • 1-js/02-first-steps/12-while-for/1-loop-last-value

1 file changed

+7
-7
lines changed
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
The answer: `1`.
1+
Atsakymas: `1`.
22

33
```js run
44
let 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
1616
let 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
```

0 commit comments

Comments
 (0)