Skip to content

Commit 32612cb

Browse files
committed
UPDATE
1 parent 5eeb1ec commit 32612cb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

JS/JS-br.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ A implementação da idéia acima sobre herança: primeiro cria uma instância d
507507
A herança de implementação com o método acima pode perfeitamente resolve a restrição no baixo nível do JS.
508508
509509
510-
# Deep and Shallow Copy
510+
# Cópia profunda e rasa
511511
512512
```js
513513
let a = {
@@ -518,6 +518,8 @@ a.age = 2
518518
console.log(b.age) // 2
519519
```
520520
521+
A partir do exemplo acima, nós podemos ver que se você assinar um objeto para uma variável, então os valores dos dois vão ter a mesma referência, um muda o outro muda adequadamente.
522+
521523
From the above example, we can see that if you assign an object to a variable, then the values of both will be the same reference, one changes, the other changes accordingly.
522524
523525
Usually, we don't want such problem to appear during development, thus we can use shallow copy to solve this problem.

0 commit comments

Comments
 (0)