Basic HTML version of Foils prepared 23 June 1997

Foil 23 JavaScript Control Structures

From JavaScript Tutorial for Certificate Course UC Web applications Certificate -- Summer 97. by Geoffrey C. Fox, Tom Scavo

Examples of Simple Conditional Statements for Foil 23
if statements must have multiple statements inside curly braces:
if ( condition ) {
statement1; statement2;
} else { // optional of course
statement3; statement4;
}
Note: there is no else if construct
for and while are essentially the same as in Java:
for ( init-exp; condition; incr-exp ) {
statement1; statement2;
}
while ( condition ) {
statement1; statement2;
}
break and continue in for and while loops are permitted. Named break as in Java or PERL are not supported.



Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Wed Apr 1 1998