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
1 if statements must have multiple statements inside curly braces:
2 if ( condition ) {
3 statement1; statement2;
4 } else { // optional of course
5 statement3; statement4;
6 }
7 Note: there is no else if construct
8 for and while are essentially the same as in Java:
9 for ( init-exp; condition; incr-exp ) {
10 statement1; statement2;
11 }
12 while ( condition ) {
13 statement1; statement2;
14 }
15 break and continue in for and while loops are permitted. Named break as in Java or PERL are not supported.

in Table To:


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