Skip to content

Commit f3874e6

Browse files
committed
Finished Deep Copy
1 parent 92d4d38 commit f3874e6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

JS/JS-br.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -612,9 +612,9 @@ console.log(b) // {name: "yck"}
612612
613613
No caso acima, você pode perceber que o método ignora a função e `undefined`.
614614
615-
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.
615+
A maioria dos dados conseguem ser serializados, então esse método resolve a maioria dos problemas, e como uma função embutida, ele tem uma performance melhor quando lidando com a cópia profunda. Certamente, você pode usar [the deep copy function of `lodash` ](https://lodash.com/docs#cloneDeep) quando sues dados contém os três casos acima.
616616
617-
If the object you want to copy contains a built-in type but doesn’t contain a function, you can use `MessageChannel`
617+
Se o objeto que você quer copiar contém um tipo embutido mas não contém uma função, você pode usar `MessageChannel`
618618
```js
619619
function structuralClone(obj) {
620620
return new Promise(resolve => {
@@ -627,8 +627,8 @@ function structuralClone(obj) {
627627
var obj = {a: 1, b: {
628628
c: b
629629
}}
630-
// pay attention that this method is asynchronous
631-
// it can handle `undefined` and circular reference object
630+
// preste atenção que esse método é assíncrono
631+
// ele consegue manipular `undefined` e referência circular do objeto
632632
const clone = await structuralClone(obj);
633633
```
634634

0 commit comments

Comments
 (0)