Skip to content

Commit

Permalink
complement descriptions of deep clone
Browse files Browse the repository at this point in the history
  • Loading branch information
zoux authored and YuChengKai committed Sep 11, 2018
1 parent 590c82e commit 566b387
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion JS/JS-br.md
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,7 @@ console.log(b.jobs.first) // FE
But this method also has its limits:
* ignore `undefined`
* ignore `symbol`
* unable to serialize function
* unable to resolve circular references in an object
```js
Expand All @@ -600,10 +601,11 @@ If an object is circularly referenced like the above example, you’ll find the
![](https://user-gold-cdn.xitu.io/2018/3/28/1626b1ec2d3f9e41?w=840&h=100&f=png&s=30123)
When dealing with function or `undefined`, the object can also not be serialized properly.
When dealing with function, `undefined` or `symbol`, the object can also not be serialized properly.
```js
let a = {
age: undefined,
sex: Symbol('male'),
jobs: function() {},
name: 'yck'
}
Expand Down
4 changes: 3 additions & 1 deletion JS/JS-ch.md
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,7 @@ console.log(b.jobs.first) // FE
但是该方法也是有局限性的:

- 会忽略 `undefined`
- 会忽略 `symbol`
- 不能序列化函数
- 不能解决循环引用的对象

Expand All @@ -639,11 +640,12 @@ console.log(newObj)

![](https://user-gold-cdn.xitu.io/2018/3/28/1626b1ec2d3f9e41?w=840&h=100&f=png&s=30123)

在遇到函数或者 `undefined` 的时候,该对象也不能正常的序列化
在遇到函数、 `undefined` 或者 `symbol` 的时候,该对象也不能正常的序列化

```js
let a = {
age: undefined,
sex: Symbol('male'),
jobs: function() {},
name: 'yck'
}
Expand Down
4 changes: 3 additions & 1 deletion JS/JS-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,7 @@ console.log(b.jobs.first) // FE
But this method also has its limits:
* ignore `undefined`
* ignore `symbol`
* unable to serialize function
* unable to resolve circular references in an object
```js
Expand All @@ -600,10 +601,11 @@ If an object is circularly referenced like the above example, you’ll find the
![](https://user-gold-cdn.xitu.io/2018/3/28/1626b1ec2d3f9e41?w=840&h=100&f=png&s=30123)
When dealing with function or `undefined`, the object can also not be serialized properly.
When dealing with function, `undefined` or `symbol`, the object can also not be serialized properly.
```js
let a = {
age: undefined,
sex: Symbol('male'),
jobs: function() {},
name: 'yck'
}
Expand Down

0 comments on commit 566b387

Please sign in to comment.