mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2024-04-21 12:32:22 +00:00
docs(object): edit Object.value()
This commit is contained in:
+3
-1
@@ -624,9 +624,11 @@ class B {
|
||||
|
||||
// B的实例继承A的实例
|
||||
Object.setPrototypeOf(B.prototype, A.prototype);
|
||||
const b = new B();
|
||||
|
||||
// B继承A的静态属性
|
||||
// B的实例继承A的静态属性
|
||||
Object.setPrototypeOf(B, A);
|
||||
const b = new B();
|
||||
```
|
||||
|
||||
《对象的扩展》一章给出过`Object.setPrototypeOf`方法的实现。
|
||||
|
||||
Reference in New Issue
Block a user