解构赋值,赋值=左右俩边的类型要一致
数组解构
var arr = ['hello','vue.sj']
var [a,b] = arr;
console.log("a",a)
console.log("b",b)
对象解构
var obj = {
name:"rmy",
age:21,
address:"北京"
}
var {name,address} = obj;
console.log('name',name)
console.log('address',address)