随笔分类 - JavaScript
摘要:构造函数 A function A() { } 构造函数 B function B() { A.call(this); } 修改 B 的原型对象 B.prototype = new A(); // contructor 指向原来的构造函数 B B.prototype.constructor = B;
阅读全文
摘要:构造函数 A function A() { } 实例对象 a var a = new A(); 原型对象 prototype 和对象原型 proto a.__proto__ A.prototype; // true constructor 属性 a.__proto__.constructor A.p
阅读全文