javascript中对象的创建-构造函数模式
摘要:
function Person(name,age,job){ this.name=name; this.age=age; this.job=job; this.sayName=function(){ alert(this.name); };} var person1=new Person("null",25,"Software Engineer");var person2=new Person("null2",250,"Software Engineer");与工厂模式区别:1.没有显式创建对象2.直接将属性和方法 阅读全文
posted @ 2014-04-08 22:52 nU|| 阅读(197) 评论(0) 推荐(0) 编辑