<!DOCTYPE html>
<html>
<body>
<script>
/**
* yeye -> baba -> erzi -> sunzi
*/
function Yeye() {
this.yeye = "yeye"
}
var yeye = new Yeye();
Baba.prototype = yeye;
function Baba() {
this.baba = "baba"
}
var baba = new Baba();
Erzi.prototype = baba;
function Erzi() {
this.erzi = "erzi"
}
var erzi = new Erzi();
Sunzi.prototype = erzi;
function Sunzi() {
}
var sunzi = new Sunzi();
</script>
</body>
</html>
子类通过__proto__来访问父类中信息