Skip to content

Commit 92d4d38

Browse files
committed
UPDATE
1 parent 79b6e54 commit 92d4d38

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

JS/JS-br.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -595,11 +595,11 @@ let newObj = JSON.parse(JSON.stringify(obj))
595595
console.log(newObj)
596596
```
597597
598-
If an object is circularly referenced like the above example, you’ll find the method `JSON.parse(JSON.stringify(object))` can’t make a deep copy of this object:
598+
Se um objto é uam referência circular como o exemplo acima, você vai encontrar o método `JSON.parse(JSON.stringify(object))` ele não pode fazer a cópia profunda desse objeto:
599599
600600
![](https://user-gold-cdn.xitu.io/2018/3/28/1626b1ec2d3f9e41?w=840&h=100&f=png&s=30123)
601601
602-
When dealing with function or `undefined`, the object can also not be serialized properly.
602+
Quando lidando com uma função ou `undefined`, o objeto pode não ser serializado adequedamente.
603603
```js
604604
let a = {
605605
age: undefined,
@@ -610,7 +610,7 @@ let b = JSON.parse(JSON.stringify(a))
610610
console.log(b) // {name: "yck"}
611611
```
612612
613-
In above case, you can see that the method ignores function and `undefined`.
613+
No caso acima, você pode perceber que o método ignora a função e `undefined`.
614614
615615
Most often complex data can be serialized, so this method can solve most problems, and as a built-in function, it has the fastest performance when dealing with deep copy. Certainly, you can use [the deep copy function of `lodash` ](https://lodash.com/docs#cloneDeep) when your data contains the above three cases.
616616

0 commit comments

Comments
 (0)