|
|
@ -1595,11 +1595,11 @@ for (let i = 0; i <= 5; i++) {
|
|
|
|
#### Conclusions
|
|
|
|
#### Conclusions
|
|
|
|
|
|
|
|
|
|
|
|
- Regular for loop can be used anywhere when the number of iteration is known.
|
|
|
|
- Regular for loop can be used anywhere when the number of iteration is known.
|
|
|
|
- While loop when the number of iteration is not know
|
|
|
|
- While loop when the number of iteration is not known.
|
|
|
|
- Do while loop and while loop are almost the same but do while loop run at least once even when the condition is false
|
|
|
|
- Do while loop and while loop are almost the same but do while loops run at least once even when the condition is false.
|
|
|
|
- for of is used only for array
|
|
|
|
- for of is used only for array items.
|
|
|
|
- forEach is used for array
|
|
|
|
- forEach is used for array items and index.
|
|
|
|
- for in is used for object
|
|
|
|
- for in is used for keys in an object.
|
|
|
|
|
|
|
|
|
|
|
|
### 6. Scope
|
|
|
|
### 6. Scope
|
|
|
|
|
|
|
|
|
|
|
|