Skip to Content
Real World XML
book

Real World XML

by Steven Holzner
January 2003
Beginner to intermediate content levelBeginner to intermediate
1200 pages
23h 42m
English
Peachpit Press
Content preview from Real World XML

Creating JavaScript for Loop Statements

Using loops, you can execute code as many times as you want—which is one of the things computers excel at. The most basic loop is the for loop statement, and here's what this statement looks like in general:

for (initialization;
					test;
					increment) {
    code
}

Here's what's happening: You place an expression in the initialization part of the for loop (which often initializes a variable, called a loop index, to 0), Then you insert a test condition in the test part of the loop to be tested each time the code in the loop has been executed. If the test is false, the loop ends (often the test condition checks whether the value in the loop index exceeds a specified maximum value). On the other hand, if the test condition ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Inside XML

Inside XML

Steven Holzner
XML Hacks

XML Hacks

Michael Fitzgerald

Publisher Resources

ISBN: 0735712867Purchase book