mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-24 10:22:23 +00:00
Update class.md
[UPDATE] 增加对 ‘__proto__’ 属性的说明;
This commit is contained in:
parent
c2d5bb201d
commit
910e94afc7
@ -290,6 +290,8 @@ p1.__proto__ === p2.__proto__
|
||||
|
||||
这也意味着,可以通过实例的`__proto__`属性为“类”添加方法。
|
||||
|
||||
> `__proto__` 并不是语言本身的特性,这是各大厂商具体实现时添加的私有属性,虽然目前很多现代浏览器的JS引擎中都提供了这个私有属性,但依旧不建议在生产中使用该属性,避免对环境产生依赖。
|
||||
|
||||
```javascript
|
||||
var p1 = new Point(2,3);
|
||||
var p2 = new Point(3,2);
|
||||
|
Loading…
x
Reference in New Issue
Block a user