mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-27 20:32:21 +00:00
Merge pull request #284 from ifishing/gh-pages
修正一个“类的实例对象”节 的错误:“它们的原型都是Point”
This commit is contained in:
commit
693fb27fed
@ -266,7 +266,7 @@ p1.__proto__ === p2.__proto__
|
||||
//true
|
||||
```
|
||||
|
||||
上面代码中,`p1`和`p2`都是Point的实例,它们的原型都是Point,所以`__proto__`属性是相等的。
|
||||
上面代码中,`p1`和`p2`都是Point的实例,它们的原型都是Point.prototype,所以`__proto__`属性是相等的。
|
||||
|
||||
这也意味着,可以通过实例的`__proto__`属性为Class添加方法。
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user