Created
April 17, 2018 14:41
-
-
Save codermarcos/b0363ba4d18b44667798854fb59bd8af to your computer and use it in GitHub Desktop.
Testando referencia
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pessoa = { | |
nome: 'Marcos', | |
contatos: { | |
email: 'coder.marcos@gmail.com' | |
} | |
}; | |
console.log('pessoa', pessoa); | |
var clone = pessoa; | |
pessoa.idade = 19; | |
console.log('pessoa', pessoa); | |
console.log('clone', clone); | |
// "pessoa" Object { nome: "Marcos", contatos: {…}, idade: 19 } | |
// "clone" Object { nome: "Marcos", contatos: {…}, idade: 19 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment