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 2018-04-03 18:36:31 +08:00
commit 577dcc4a97

View File

@ -370,7 +370,7 @@ class B extends A {
let b = new B();
```
上面代码中,`super.valueOf()`表明`super`是一个对象,因此就不会报错。同时,由于`super`使得`this`指向`B`,所以`super.valueOf()`返回的是一个`B`的实例。
上面代码中,`super.valueOf()`表明`super`是一个对象,因此就不会报错。同时,由于`super`使得`this`指向`B`的实例,所以`super.valueOf()`返回的是一个`B`的实例。
最后,由于对象总是继承其他对象的,所以可以在任意一个对象中,使用`super`关键字。