const user={ // name:"hundsun", // age:16 data:{name:"yss",age:12}, list:[ {price:12}, {price:12}, {price:13} ], //访问其伪造属性操作 get total(){ return this.list.reduce((t,l)=>{ return t+l.price },0); } } user.age=13; console.log(user.total);