Skip to content

Instantly share code, notes, and snippets.

@xyzdata
Last active August 27, 2017 15:35
Show Gist options
  • Save xyzdata/7d861fde6dd15262ae007e68ca0898f0 to your computer and use it in GitHub Desktop.
Save xyzdata/7d861fde6dd15262ae007e68ca0898f0 to your computer and use it in GitHub Desktop.
`1` for `warnings` and `2` for `errors` & "rules": { "semi": [2, "always"] }
@xyzdata
Copy link
Author

xyzdata commented Jun 30, 2017

ES7 Object Spread - 试验性 (尚未标准化)

vikingmute/webpack-react-codes#30

数组是可以用到的,但是对象一直报错!

@gaoxiaopang

https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment

// ES7 - 试验性 (尚未标准化)
// Uncaught SyntaxError: Unexpected token ...
({a, b, ...rest} = {a:1, b:2, c:3, d:4});

image

@xyzdata
Copy link
Author

xyzdata commented Jun 30, 2017

({a, b, ...rest} = {a:1, b:2, c:3, d:4});

{a, b, ...rest} = {a:1, b:2, c:3, d:4};

[a, b, c, d] = [1, 2, 3, 4];

[a, b, ...rest] = [1, 2, 3, 4];

[x, y, z, ...rest] = [a, b, c, d];

([x, y, z, ...rest] = [a, b, c, d]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment