Merge pull request #489 from ColdMoonMao/patch-1

Update class-extends.md
This commit is contained in:
Ruan YiFeng
2017-08-25 17:00:18 +08:00
committed by GitHub
+1 -1
View File
@@ -399,7 +399,7 @@ Object.setPrototypeOf(B, A);
B.__proto__ = A;
```
这两条继承链,可以这样理解:作为一个对象,子类(`B`)的原型(`__proto__`属性)是父类(`A`);作为一个构造函数,子类(`B`)的原型(`prototype`属性)是父类的实例。
这两条继承链,可以这样理解:作为一个对象,子类(`B`)的原型(`__proto__`属性)是父类(`A`);作为一个构造函数,子类(`B`)的原型对象`prototype`属性)是父类的原型对象(`prototype`属性)的实例。
```javascript
Object.create(A.prototype);