摘要:
1.普通模式var person = new Object();person.name = "Laughing";person.age = 28;person.job = "Software Engineer";peron.sayName = function(){ alert(this.name);};person.sayName();缺点:创建多个对象时,会产生大量的重复代码。2.工厂模式function createPerson(name, age, job){ var o = new Object(); o.name = name; o.age 阅读全文