// create a new car object
var car = new Object();
// add some properties to the car object...
car.maker = "Dodge";
car.model = "Viper";
car.color = "Silver";
// display all the car object's property values...
alert( car.color + " " + car.maker + " " + car.model );
// add a method to the car object...
car.startup = startup;
// define the startup method...
function startup()
{
alert("... the motor is now running!");
}
// call the car object's startup method...
car.startup();
//-----------------------------------
// You can also create a new instance of the car object like this...
// var van = new Object(car);
// van.model = "RAM day van";
// van.color = "Blue and White";
// alert(van.color + " " + van.maker + " " + van.model );