使用call()方法改变this指向实现继承 function A(x, y){ this.x = x; this.y = y; } // 如果要继承父类的方法,添加下面两句 B.prototype = new A() B.prototype.constructor = B // 利用对象的方式修改了原型对象要指回构造函数B function B(x, y){ A.call(this, x, y) // 改变this指向 } obj = new B(1, 2);