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