You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: loops/while.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
1
# While Loop
2
2
3
-
While Loops can execute a block of code as long as a specified condition is true.
3
+
While Loops repetitively execute a block of code as long as a specified condition is true.
4
4
5
5
```javascript
6
6
while(condition){
7
7
// do it as long as condition is true
8
8
}
9
9
```
10
10
11
-
For example, The loop in this example will continue to run as long as the variable i is less than 5:
11
+
For example, the loop in this example will repetitively execute its block of code as long as the variable i is less than 5:
12
12
13
13
```javascript
14
14
var i =0, x ="";
@@ -18,7 +18,7 @@ while (i < 5) {
18
18
}
19
19
```
20
20
21
-
The do/while loop is a variant of the while loop. This loop will execute the code block once, before checking if the condition is true, then it will repeat the loop as long as the condition is true:
21
+
The Do/While Loop is a variant of the while loop. This loop will execute the code block once before checking if the condition is true. It then repeats the loop as long as the condition is true:
0 commit comments