loop
This commit is contained in:
parent
cc23f7c914
commit
ee6c80b7ad
@ -89,11 +89,15 @@ for(let i = 0; i < X; i++) {
|
|||||||
// do_somethings();
|
// do_somethings();
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
where the 3 statements
|
where
|
||||||
```
|
|
||||||
-> "let i = 0" is the declaration and initialisation of the control variable (i)
|
```javascript
|
||||||
-> "i < X" is the continuation condition (i.e. if the condition is true, then executed the statement in the loop > do_something();, exit the loop when it is false)
|
let i = 0
|
||||||
-> "i++" is the incremental/update statement that is executed at the end of the loop (i.e. after the statement in the loop as been executed)
|
is the declaration and initialisation of the control variable (i)
|
||||||
|
i < X
|
||||||
|
is the continuation condition: if the condition is true, then executed the statement in the loop [do_something();], exit the loop when the consition is false
|
||||||
|
i++
|
||||||
|
is the incremental (update) statement that is executed at the end of the loop (i.e. after the loop statement [do_something();] as been executed)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user