function Student(name, age) {
this.name = name
this.age = age
}
Student.prototype = {
constructor: Student,
study: function() {
console.log('在学习')
}
}
var zs = new Student('张三', 18)
构造函数,实例对象,原型对象三角关系
最新推荐文章于 2022-08-30 17:20:15 发布