js 数组和对象解构
//数组 - - //结构赋值 // const arr = [[2,6,8],4,9] // let [a,b,c] = arr // console.log(a) //2 // console.log(b) //4 // console.log(c) //9 //交换变量 // let a = 1 // let b =4; //分号一定要加 不按程序会以为 let b =4[b,a] = [a,b] 这样就会报错 // [b,a] = [a,b] // console.log(a,b) // const [n1,[n2,n3]] = ['华为',['小米','酷派']] // console.log(n1); // console.log(n2); // console.log(n3); //对象 const libai = {name:'你能',age:22} let {name} = libai console.log(name)