1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-29 05:42:20 +00:00

Update object.md

这两段不知所云的英文插进代码段要干什么
This commit is contained in:
snow212-cn 2018-06-07 22:34:19 +08:00 committed by GitHub
parent cdc7e48d93
commit 6583714f3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1426,8 +1426,6 @@ let newVersion = {
```javascript
let aWithDefaults = { x: 1, y: 2, ...a };
// 等同于
even if property keys dont clash, because objects record insertion order:
let aWithDefaults = Object.assign({}, { x: 1, y: 2 }, a);
// 等同于
let aWithDefaults = Object.assign({ x: 1, y: 2 }, a);
@ -1447,8 +1445,6 @@ const obj = {
```javascript
{...{}, a: 1}
// { a: 1 }
even if property keys dont clash, because objects record insertion order:
```
如果扩展运算符的参数是`null``undefined`,这两个值会被忽略,不会报错。