- Hands-On Full Stack Web Development with Aurelia
- Diego Jose Argüelles Rojas Erikson Haziz Murrugarra Sifuentes
- 69字
- 2021-06-25 20:58:15
Destructuring
We have a new way to assign values to objects and arrays. Let’s look at some examples:
var [a, b] = ["hello", "world"];
console.log(a); // "hello"
console.log(b); // "world"
var obj = { name: "Diego", lastName: "Arguelles" };
var { name, lastName } = obj;
console.log(name); // "Diego"
var foo = function() {
return ["175", "75"];
};
var [height, weight] = foo();
console.log(height); //175
console.log(weight); //75
推薦閱讀
- EJB 3.1從入門(mén)到精通
- 物聯(lián)網(wǎng)與北斗應(yīng)用
- RCNP實(shí)驗(yàn)指南:構(gòu)建高級(jí)的路由互聯(lián)網(wǎng)絡(luò)(BARI)
- SEO 20日
- 數(shù)字通信同步技術(shù)的MATLAB與FPGA實(shí)現(xiàn):Altera/Verilog版(第2版)
- Mastering TypeScript 3
- Learning Swift(Second Edition)
- Mastering Dart
- 光纖通信系統(tǒng)與網(wǎng)絡(luò)(修訂版)
- 4G小基站系統(tǒng)原理、組網(wǎng)及應(yīng)用
- 網(wǎng)絡(luò)安全應(yīng)急響應(yīng)技術(shù)實(shí)戰(zhàn)指南
- 語(yǔ)音信號(hào)處理及Blackfin DSP實(shí)現(xiàn)
- AIoT應(yīng)用開(kāi)發(fā)與實(shí)踐
- 華為HCIA-Datacom認(rèn)證指南
- 圖神經(jīng)網(wǎng)絡(luò)前沿