原型链继承测试

1     function Person() {
2       this.name = 'zs';
3     }
4     function Zs() {
5       this.age = 20
6     }
7     Zs.prototype = new Person()
8     console.log(Zs.name)

 

posted @ 2020-06-28 09:54  爱迪西  阅读(76)  评论(0)    收藏  举报