var Car =function(make,model,year){this.make = make;this.model = model;this.year = year;this.getMake =function(){returnthis.make;}}//单例模式的简单工厂
var myCarInfo =function(){this.createCar =function(make,model,year,owner,tag,renewDate){
var c =carInfoFactory(make,model,year);
c["owner"]= owner;
c["tag"]= tag;
c["renewDate"]= renewDate;return c;}}
var carInfoFactory =(function(){
var carInfo ={};returnfunction(make,model,year){if(carInfo[make+model+year]){return carInfo[make+model+year];}else{
var newCar =newCar(make,model,year);
carInfo[make+model+year]= newCar;return newCar;
a
}}})();
var test =newmyCarInfo();
var startDate =newDate().getTime();
var ca =newArray();for(var i =0; i <4150000; i++){
ca.push(test.createCar("BMW","宝马","2017-10-18","","GBMW88","2017-10-19"))}
var endDate =newDate();alert(endDate - startDate);