GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Merge pull request #76 from sumn2u/master · AvidCoder101/javascript@cf6d822

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • en
    • SUMMARY.md
    • loops
      • dowhile.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎en/SUMMARY.md‎

Copy file name to clipboardExpand all lines: en/SUMMARY.md
+1Lines changed: 1 addition & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
* [Loops](loops/README.md)
2525
* [For](loops/for.md)
2626
* [While](loops/while.md)
27+
* [Do...While](loops/dowhile.md)
2728
* [Functions](functions/README.md)
2829
* [Declare](functions/declare.md)
2930
* [Higher order](functions/higher_order.md)
Collapse file

‎en/loops/dowhile.md‎

Copy file name to clipboard
+35Lines changed: 35 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Do...While Loop
2+
3+
The do...while statement creates a loop that executes a specified statement until the test condition evaluates to be false. The condition is evaluated after executing the statement.
4+
Syntax for do... while is
5+
6+
```javascript
7+
do{
8+
// statement
9+
}
10+
while(expression) ;
11+
```
12+
13+
Lets for example see how to print numbers less than 10 using `do...while` loop:
14+
15+
```
16+
var i = 0;
17+
do {
18+
document.write(i + " ");
19+
i++; // incrementing i by 1
20+
} while (i < 10);
21+
```
22+
23+
>***Note***: `i = i + 1` can be written `i++`.
24+
25+
26+
{% exercise %}
27+
Using a do...while-loop, print numbers between less than 5.
28+
{% initial %}
29+
var i = 0;
30+
{% solution %}
31+
var i = 0;
32+
do {
33+
i++; // incrementing i by 1
34+
} while (i < 5);
35+
{% endexercise %}

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.