HELP! * YELLOW=global GREY=local Global HTML version of Foils prepared 21 February 97

Foil 8 The JavaScript Language -- Conditionals

From Feb 17/19 Delivered Lecture for Course CPS616 -- aJavaScript Language Objects and Frames CPS616 spring 1997 -- Feb 17 and 19 1997. by Geoffrey Fox * Important Information in IMAGE
Secs 133.9 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 Fri Feb 21 1997