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])
}

运行结果

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

阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6
标签: vue