const obj ={
name:'lxz',
age:18,
height:1.88,
city:'xxx'
}
//es5
const name = obj.name;
const age= obj.age;
const height= obj.height;
console.log(name)
console.log(age)
console.log(height)
//es6
const {name,age,height} = obj;
console.log(name)
console.log(age)
console.log(height)
网友评论