Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update: inherit.md 修改一个错误 #437

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/JavaScript/inherit.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ Child6.prototype.getFriends = function () {
}

let person6 = new Child6();
console.log(person6); //{friends:"child5",name:"child5",play:[1,2,3],__proto__:Parent6}
console.log(person6); //{friends:"child5",name:"parent6",play:[1,2,3],__proto__:Parent6}
console.log(person6.getName()); // parent6
console.log(person6.getFriends()); // child5
```
Expand Down Expand Up @@ -310,4 +310,4 @@ asuna.getName() // 成功访问到父类的方法
通过`Object.create` 来划分不同的继承方式,最后的寄生式组合继承方式是通过组合继承改造之后的最优继承方式,而 `extends` 的语法糖和寄生组合继承的方式基本类似

## 相关链接
https://zh.wikipedia.org/wiki/%E7%BB%A7%E6%89%BF
https://zh.wikipedia.org/wiki/%E7%BB%A7%E6%89%BF