logo
  • 教程列表
  • SO官方文檔
  • 帶有 Node.js 的 ECMAScript 2015(ES6)
    • constlet 宣告
    • 箭頭函式
    • 箭頭函式示例
    • 解構
    • 流
    • ES6 課程
  1. StackOverflow 文件
  2. Node.js 教程
  3. 帶有 Node.js 的 ECMAScript 2015(ES6)
  4. 解構

解構

Created: November-22, 2018

    let [x,y, ...nums] = [0, 1, 2, 3, 4, 5, 6];
console.log(x, y, nums);

let {a, b, ...props} = {a:1, b:2, c:3, d:{e:4}}
console.log(a, b, props);

let dog = {name: 'fido', age: 3};
let {name:n, age} = dog;
console.log(n, age);
  • 流
  • 箭頭函式示例

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明