constinfo = {person: {name:'xiaobe',other: {age:22, } },song:'rolling',}// 解构person的内容const{person: { name,other: { age } } } = info;// 解构songconst{ song } = info;
但请注意, person和other是属于未定义的变量
转自https://www.cnblogs.com/soyxiaobi/p/10567826.html
侵权删!
网友评论