This commit is contained in:
Ilya Kantor 2016-03-04 19:06:22 +03:00
parent e78e527866
commit 05a93ced80
212 changed files with 3213 additions and 3968 deletions

View file

@ -1,7 +1,6 @@
The answer: `1`.
```js
//+ run
```js run
let i = 3;
while (i) {
@ -9,7 +8,7 @@ while (i) {
}
```
Every loop iteration decreases `i` by `1`. The check `while(i)` stops the loop when `i = 0`.
Every loop iteration decreases `i` by `1`. The check `while(i)` stops the loop when `i = 0`.
Hence, the steps of the loop make the following sequence ("loop unrolled"):

View file

@ -1,6 +1,8 @@
# Last loop value
importance: 3
[importance 3]
---
# Last loop value
What is be the last value alerted by this code? Why?