let arr={
name:'高山我梦',
agea:18
};
//想要拿到对象arr里面的name是拿不到的
console.log(name);//<empty string>
------------------------------------------------------------------
let arr={
name:'高山我梦',
agea:18
};
let {name}=arr;//加上这句,把name解出来
console.log(name);//高山我梦
------------------------------------------------------------------
加冒号可以重命名,原来的名字失效
let arr={
name:'高山我梦',
agea:18
};
let {name:rename}=arr;
console.log(name);//<empty string>
console.log(rename);//高山我梦