Skip to content

Instantly share code, notes, and snippets.

@matteocargnelutti
Last active March 23, 2018 20:22
Show Gist options
  • Select an option

  • Save matteocargnelutti/6fef29ef5da7b064f3e9f14021d25fb2 to your computer and use it in GitHub Desktop.

Select an option

Save matteocargnelutti/6fef29ef5da7b064f3e9f14021d25fb2 to your computer and use it in GitHub Desktop.
JS const article #4
let foo = {x: 12};
const bar = foo;
console.log(bar); // { x: 12 }
foo.x = 13;
console.log(bar); // { x: 13 } !! bar's content has been affected by the changes made in foo !
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment