Tuesday, June 26, 2007

Javascript Object Constructors

A constructor is a function that you intend to use to create objects. In the following example, car is the constructor and mycar is the object:

function car(make, model, year) {
this.make = make;
this.model = model;
this.year = year;

mycar = new car("Eagle", "Talon TSi", 1993);

No comments: