Loops
-
Execute statements a given number of times.
-
Fixed, or based on a variable.
-
for, while, do - while, for - in
for (i = 0; i < classlist.length; i++ ) {
document.write("Welcome " + classlist[i] + "!<br>");
}
-
Note that conditional statements and loops do not end in semicolons ;
per se, but enclose the statements in curly braces {}.
What would happen if you did end a conditional
or loop with a semicolon?
order of execution
Home
Internet II: Day 2