function Car(sColor, iDoors) {
this.color = sColor;
this.doors = iDoors;
this.drivers = new Array("A", "B");
}
Car.prototype.showColor = function () {
alert(this.color);
};
var myHourse1 = new Car("red", 4);
var myHourse2 = new Car("blue", 3);
myHourse1.drivers.push("C");
alert(myHourse1.drivers);
alert(myHourse2.drivers);
|