Created
March 4, 2022 02:28
-
-
Save yeonwooz/2c47a20eea5fe26e17cfe677b4062dfe to your computer and use it in GitHub Desktop.
shallow copy
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 whiteShirt = { | |
name: 'whiteShirt', | |
size: 'm', | |
price: '100,000', | |
discountedPrice: '50,000', | |
} | |
const pants = whiteShirt | |
pants.name = 'pants' | |
console.log(whiteShirt.name) // 'pants' | |
console.log(pants.name) // 'pants' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment