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 — Add introduction for loops · yuezhangda/javascript@31329ed

File tree

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

‎SUMMARY.md‎

Copy file name to clipboardExpand all lines: SUMMARY.md
+4-1Lines changed: 4 additions & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,7 @@
1616
* [If](conditional/if.md)
1717
* [Else](conditional/else.md)
1818
* [Comparators](conditional/comparators.md)
19-
* [Concatenate](conditional/concatenate.md)
19+
* [Concatenate](conditional/concatenate.md)
20+
* [Loops](loops/README.md)
21+
* [For](loops/for.md)
22+
* [While](loops/while.md)
Collapse file

‎loops/README.md‎

Copy file name to clipboard
+21Lines changed: 21 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Loops
2+
3+
Loops are repetitive conditions where one variable in the loop changes. Loops are handy, if you want to run the same code over and over again, each time with a different value.
4+
5+
Instead of writing:
6+
7+
```javascript
8+
doThing(cars[0]);
9+
doThing(cars[1]);
10+
doThing(cars[2]);
11+
doThing(cars[3]);
12+
doThing(cars[4]);
13+
```
14+
15+
You can write:
16+
17+
```javascript
18+
for (var i=0; i < cars.length; i++) {
19+
doThing(cars[i]);
20+
}
21+
```

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.