From 7518f7b12da4d8d2de1cf4a5a948a0b832c8e183 Mon Sep 17 00:00:00 2001 From: ruanyf Date: Mon, 13 May 2019 17:24:27 +0800 Subject: [PATCH] docs(class-extends): fix #854 --- docs/class-extends.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/class-extends.md b/docs/class-extends.md index 5d112c4..578b903 100644 --- a/docs/class-extends.md +++ b/docs/class-extends.md @@ -447,7 +447,7 @@ B.__proto__ = A; 这两条继承链,可以这样理解:作为一个对象,子类(`B`)的原型(`__proto__`属性)是父类(`A`);作为一个构造函数,子类(`B`)的原型对象(`prototype`属性)是父类的原型对象(`prototype`属性)的实例。 ```javascript -Object.create(A.prototype); +B.prototype = Object.create(A.prototype); // 等同于 B.prototype.__proto__ = A.prototype; ```