1
0
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:
ruanyf 2016-11-25 13:12:25 +08:00
commit d6d9ab4ae3

View File

@ -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添加方法。