Another User-defined Object
Here's another example:function Car( make, model ) { this.make = make || ""; this.model = model || ""; this.color = null; this.setColor = new Function( "color", "this.color = color" );}
Instantiate a Car object with new:myCar = new Car( "Ford", "Explorer" );myCar.setColor( "red" );