let [a, b, c] = [1, 2, 3];
 let [foo, [[bar], baz]] = [1, [[2], 3]];
foo //
bar //
baz // let [ , , third] = ["foo", "bar", "baz"];
third // "baz" let [x, , y] = [1, 2, 3];
x //
y // let [head, ...tail] = [1, 2, 3, 4];
head //
tail // [2, 3, 4] let [x, y, ...z] = ['a'];
x // "a"
y // undefined
z // []
 // 报错
let [foo] = 1;
let [foo] = false;
let [foo] = NaN;
let [foo] = undefined;
let [foo] = null;
let [foo] = {};
 let [x, y, z] = new Set(['a', 'b', 'c']);
x // "a"
 let [foo = true] = [];
foo // true let [x, y = 'b'] = ['a']; // x='a', y='b'
let [x, y = 'b'] = ['a', undefined]; // x='a', y='b'
 let [x = 1] = [undefined];
x // let [x = 1] = [null];
x // null
 let [x = 1, y = x] = [];     // x=1; y=1
let [x = 1, y = x] = [2]; // x=2; y=2
let [x = 1, y = x] = [1, 2]; // x=1; y=2
let [x = y, y = 1] = []; // ReferenceError
 let { foo, bar } = { foo: "aaa", bar: "bbb" };
foo // "aaa"
bar // "bbb"
 let { bar, foo } = { foo: "aaa", bar: "bbb" };
foo // "aaa"
bar // "bbb" let { baz } = { foo: "aaa", bar: "bbb" };
baz // undefined
 var { foo: baz } = { foo: 'aaa', bar: 'bbb' };
baz // "aaa" let obj = { first: 'hello', last: 'world' };
let { first: f, last: l } = obj;
f // 'hello'
l // 'world'
 let { foo: baz } = { foo: "aaa", bar: "bbb" };
baz // "aaa"
foo // error: foo is not defined

最新文章

  1. 用SQL命令查看Mysql数据库大小
  2. 黑马程序员----java基础笔记中(毕向东)
  3. Ueditor的两种定制方式
  4. 关于VS2015找不到WIN32的解决办法
  5. 设计包含min函数的栈
  6. 【Linux】鸟哥的Linux私房菜基础学习篇整理(九)
  7. (摘)Zebra打印机异常处理
  8. 深入理解PreparedStatement和Statement
  9. C++容器在遍历时的删除问题
  10. weblogic的ejb远程调用
  11. fpga该驱动器调试dev_dbg 无输出
  12. 在windows server2003下安装Redmine
  13. js设置、获取、清除cookie
  14. 开源社交系统ThinkSNS+ V0.8.0 正式发布(一期功能版本)
  15. IIS发布 用户 \'IIS APPPOOL\\X\' 登录失败
  16. C/C++下调用matlab函数操作说明
  17. JCE安装使用报错
  18. nginx配置前端代理
  19. 使用 CODING 进行 Hexo 项目的持续集成
  20. C和C指针小记(三)-整型,char,枚举

热门文章

  1. 数据库质疑修复(SUSPECT)总结,DBCC报错
  2. C++语言的I/o使用方法详解
  3. python有哪些好的学习资料或者博客?
  4. css的继承性理解
  5. Android系统源代码的下载与编译
  6. Linux图像系统框架-理解X11与Qt的层次结构
  7. 【Head First Servlets and JSP】笔记6:什么是响应首部 & 快速搭建一个简单的测试环境
  8. P4501 [ZJOI2018]胖
  9. PHP的垃圾回收机制以及大概实现
  10. Golang 高性能UDP Server实现