前端学习笔记202310学习笔记第一百零玖天-vue3-链式调用&对象属性与遍历&this指向&caller_callee之11

var obj={
    name:"geyao",
    age:22
}
function Car(){
    this.brand="Benz",
    this.color="red",
    this.size=18
}
Car.prototype={
    age:18,
    width:2.5
}
Object.prototype.sex="女"
var car=new Car()
for(var key in car){
    console.log(key+'+'+car[key])
}

运行结果

posted @ 2023-10-31 09:23  前端导师歌谣  阅读(3)  评论(0编辑  收藏  举报  来源