📜  javascript 破坏 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:17.051000             🧑  作者: Mango

代码示例2
/*
* On the left-hand side, you decide which values to unpack from the right-hand
* side source variable.
* 
* This was introduced in ES6
*/
const x = [1, 2, 3, 4, 5]
const [a, b] = x
console.log(a) // prints out: 1
console.log(b) // prints out: 2