mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-24 18:32:22 +00:00
Merge branch 'gh-pages' of github.com:ruanyf/es6tutorial into gh-pages
This commit is contained in:
commit
d6d9ab4ae3
@ -266,7 +266,7 @@ p1.__proto__ === p2.__proto__
|
|||||||
//true
|
//true
|
||||||
```
|
```
|
||||||
|
|
||||||
上面代码中,`p1`和`p2`都是Point的实例,它们的原型都是Point,所以`__proto__`属性是相等的。
|
上面代码中,`p1`和`p2`都是Point的实例,它们的原型都是Point.prototype,所以`__proto__`属性是相等的。
|
||||||
|
|
||||||
这也意味着,可以通过实例的`__proto__`属性为Class添加方法。
|
这也意味着,可以通过实例的`__proto__`属性为Class添加方法。
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user