摘要: 工厂模式 function createPersonal(name,age,job){ var o = new Object(); o.name = name; o.age = age; o.job = job; o.sayName = function(){ alert(this.name); } 阅读全文
posted @ 2017-04-03 23:02 Nextfuture 阅读(110) 评论(0) 推荐(0)
摘要: 实现原型链有一种基本模式,其代码大致如下: function A(){ this.property = true; } A.prototype.getAvalue = function(){ return this.property; }; function B(){ this.property = 阅读全文
posted @ 2017-04-03 22:59 Nextfuture 阅读(495) 评论(0) 推荐(0)