Basic HTML version of Foils prepared 1 Dec 97

Foil 68 User-defined Objects

From Overview of Basic JavaScript -- Web Client Scripting Language Jackson State CSC499 -- Fall Semester 97. by Tom Scavo,Geoffrey C. Fox


1 Arbitrary objects are defined with the function statement: function car(make, model) { this.make = make; this.model = model; this.color = null; this.setColor = new Function("color", "this.color = color"); }
2 Instantiate an object with new: myCar = new Car("Ford", "Explorer"); myCar.setColor("red");

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 Sun Nov 29 1998