摘要: 1 简单工厂模式var CarFactory = function(){};CarFactory.prototype= { createCar: function(type){ varcar= null; switch(type){ case 'ford': car= new Ford();break; case 'jetta': car= new Jetta();break; default: car= new Lancer(); } }}var CarShop = new function(){}CarShop.prototype = { sellCar: 阅读全文
posted @ 2013-02-03 13:15 舟~ 阅读(328) 评论(0) 推荐(0) 编辑