继承和函数进阶
组合继承
<script>
// 组合继承:属性继承(call)、方法继承(原型继承)
var Person = function (name, age) {
this.name = name
this.age = age
}
Person.prototype.sayHi = function () {
console.log('hi')
}
var Student = function (name, age,
原创
2022-04-04 09:28:44 ·
126 阅读 ·
0 评论