|
|
|
@ -77,6 +77,8 @@ The `for` loop requires 3 parts to iterate:
|
|
|
|
|
- `condition` Expression that uses comparison operators to cause the loop to stop when `false`
|
|
|
|
|
- `iteration-expression` Runs at the end of each iteration, typically used to change the counter value
|
|
|
|
|
|
|
|
|
|
✅ Note: All the above mentioned three parts are optional you can skip any of them or all of them to get different results.
|
|
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
|
// Counting up to 10
|
|
|
|
|
for (let i = 0; i < 10; i++) {
|
|
|
|
|