Created
April 11, 2020 11:14
-
-
Save rchougule/e0a5e958afe1659ef401413a7ed4f665 to your computer and use it in GitHub Desktop.
Copying an Object in Node.js is by default via Reference
This file contains hidden or 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 sports = { | |
default: false | |
}; | |
const copySports = sports; | |
copySports.default = true; | |
console.log(sports); | |
//OUTPUT | |
// { default: true } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment