Skip to content

Instantly share code, notes, and snippets.

@rchougule
Created April 11, 2020 11:14
Show Gist options
  • Save rchougule/e0a5e958afe1659ef401413a7ed4f665 to your computer and use it in GitHub Desktop.
Save rchougule/e0a5e958afe1659ef401413a7ed4f665 to your computer and use it in GitHub Desktop.
Copying an Object in Node.js is by default via Reference
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