陣列解構:
const foo = [1,2,3]
const [a, b, c] = foo;
console.log(a,b,c) // 1,2,3
物件解構:
const obj = {
name: 'AA',
id: '111'
}
const {name, id} = obj;
console.log(name, id) // AA,111
陣列解構:
const foo = [1,2,3]
const [a, b, c] = foo;
console.log(a,b,c) // 1,2,3
物件解構:
const obj = {
name: 'AA',
id: '111'
}
const {name, id} = obj;
console.log(name, id) // AA,111