Light Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 92d4d38

Browse files
committed
UPDATE
1 parent 79b6e54 commit 92d4d38

File tree

1 file changed

+3
-3
lines changed
  • JS
    • JS-br.md

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 e uam referencia circular como o exemplo acima, voce vai encontrar o metodo `JSON.parse(JSON.stringify(object))` ele nao pode fazer a copia 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 funcao ou `undefined`, o objeto pode nao 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, voce pode perceber que o metodo ignora a funcao 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)