Basic HTML version of Foils prepared 23 June 1997

Foil 29 The with Statement

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


with ( ParticularObject ) {
// any old statements É
}
Within the curly braces, ParticularObject is the default object for any property or method that does not specify a parent object
with (Math) { // An example
area = PI*r*r; // Math property PI
x = r*cos(theta); // Math method cos
y = r*sin(theta); // Math method sin
}



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