HELP! * GREY=local LOCAL HTML version of Foils prepared 15 January 1997

Foil 23 The JavaScript Language -- Conditionals

From JavaScript Tutorial for CPS616 Technologies of the Information Age 1997 Basic Information Track of CPS -- Spring Semester 97. by Geoffrey C. Fox * Important Information in IMAGE
Addon
These are roughly a subset of those in Java
if statements cannot use else if and must have statements to be executed placed in curly braces unless only one statement
if( condition ) {
Need curlies if more than one statement here; }
else { // Optional of course
Statements which can contain nested if's; }
for and while are essentially as in Java
for( initial expression ; condition; increment expression ) {
statements to execute; }
while(condition) {
stuff to do as long as condition true; }
break can appear in for or while loops and causes control to pass to statement after end of for or while loop. Named break's as in Java or PERL are not supported
continue in a for or while loop skips over remaining statements in body and goes to next iteration of each loop



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 Feb 19 1997