Created
July 21, 2020 01:48
-
-
Save katepapineni/fd9c4df22d6d7457e14af0352f25880f to your computer and use it in GitHub Desktop.
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
const dog1 = { | |
name: 'Scout', | |
age: 7, | |
}; | |
const dog2 = { | |
name: 'Snoopy', | |
age: 3, | |
}; | |
const dog3 = dog1; | |
dog3.name = 'Pickles'; | |
const dog4 = { ...dog2 }; | |
dog4.name = 'Muffin'; | |
// What's the output? | |
console.log(dog1.name); | |
console.log(dog2.name); | |
console.log(dog3.name); | |
console.log(dog4.name); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment