HELP! * GREY=local LOCAL HTML version of Foils prepared 26 February 1996

Foil 19 The JavaScript with Statement for objects

From CPS616 Lectures on JavaScript CPS616 Basic Information Track for Computational Science -- Winter-Spring Semester 96. by Geoffrey C. Fox * See also color IMAGE

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



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 Tue Feb 18 1997