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


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

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