2015年7月29日
摘要: JavaScript高级程序设计读书笔记这本书继承的实现列举了好几种,里面有两种是比较靠谱的。1 组合继承//父构造函数function Super(name) { this.name = name; this.colors = ['black', 'red'];}Super.proto... 阅读全文
posted @ 2015-07-29 15:08 晨祥 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 1 for in循环:使用它时,要主要遍历的是所有可枚举的属性(实例以及原型中的属性)function Person(name){ this.name = name;}Person.prototype.getName=function(){ return this.name;}var p... 阅读全文
posted @ 2015-07-29 08:51 晨祥 阅读(101) 评论(0) 推荐(0) 编辑