//Car factory in the 1960s
var ocar=new Object ;
ocar.color="black";
ocar.doors=2;
ocar.pinpai="Liberation";
ocar.showPinpai=function()
{
alert (this.pinpai);//A production line is needed to produce a car, and a new production line needs to be built to produce the next car
}
//Car factory in the 1970s
function createcar()
{
var oTempCar=new Object;
oTempCar.color="black";
oTempCar.doors=4;
oTempCar.pinpai="Santana"; )
{
alert(this.pinpai); // Convenient production, one production line can produce multiple cars
}
return oTempCar;
}
//Produced in the 1980s Car
function createcar(sColor,iDoors,sPinpai)
{
var oTempCar=new Object;
oTempCar.color=sColor; oTempCar.pinpai=sPinpai;
oTempCar.showPinpai=function()
{
alert(this.pinpai);//Convenient production, one-time molding
}
return oTempCar;
}
//Cars produced in the 90s
function showPinpai()
{
alert(this.color);
}
function createcar(sColor,iDoors,sPinpai )
{
var oTempCar=new Object;
oTempCar.color=sColor;
oTempCar.doors=iDoors;
oTempCar.pinpai=sPinpai; )
return oTempCar;
}
var oBmw=createcar("black",4,"BMW");
oBmw.showColor();//One-time molding and assembly production