var obj = {
name:"Jack",
sex:"男",
age:20,
wife:{
name:"Rose",
sex:"女",
age:18,
},
}
var {name:a,sex,wife:{name:c,sex}} = obj;
console.log(a) //jack
console.log(c) //rose
console.log(name) //rose
console.log(sex) //女
console.log(x) //20
var {sex} = obj; // only when a defined priority printing attribute value outermost
console.log(sex); //男
Deconstruction assignment nested objects,
When an alias, alias direct printing;
Attribute names are the same, the print priority innermost {} in the attribute.