标签:last title code ext 解构赋值 OLE color 属性 console
let options = { title: ‘menu‘, width: 100, height: 200 } //如果简写,变量名必须和属性名一致 let {title,width,height} = options console.log(title,width,height) let {title:title2,width,height} = options console.log(title2,width,height) let {title, ...last} = options console.log(title,last) //嵌套对象 let options = { size: { width:100, height:200 }, items:[‘he‘,‘ee‘], extra: true } let {size:{width,height},items:[item1],extra} = options console.log(width,height,item1,extra)
标签:last title code ext 解构赋值 OLE color 属性 console
原文地址:https://www.cnblogs.com/qjb2404/p/12210744.html