前端学习笔记202310学习笔记第一百零玖天-vue3-链式调用&对象属性与遍历&this指向&caller_callee之23
function Test(){
this.name='123'
}
var test=new Test()
console.log(test.name)
function Person(name,age){
this.name="geyao"
this.age=18
}
function Programmer(name,age){
Person.apply(this,[name,age])
this.work="Programmer"
}
var p=new Programmer("geyao",18)
console.log(p)
运行结果