var o={
name:"qiaozhen",
work:function(){
console.log("working...");
},
_age:20,
get age(){
return this._age;
},
set age(val){
if(val<0||val>150){
throw new Error("invalid value");
}else{
this._age=val;
}
},
address:{
home:"jiating",
office:"office"
}
};
赋值操作,判断对象存不存在,值存不存在
var reslt=o&&o.home&&o.home.person