摘要: 一般继承方式如下function people(n){ this.name =n;}function worker(name,num){ people.call(this, name); this.num =num;}worker.prototype =new people()worker.prototype.constructor = worker1 原型方式比较灵活function people(n){ this.name =n;}可以先生成对象,然后添加原型方法var p1 = new people('zj')people.prototype.show = f... 阅读全文
posted @ 2013-10-31 10:09 oneroom 阅读(181) 评论(0) 推荐(0) 编辑
让别人快乐是慈悲,让自己快乐是智慧!