I hereby claim:
- I am matteocargnelutti on github.
- I am matteoatlil (https://keybase.io/matteoatlil) on keybase.
- I have a public key ASCAXjTRPQa5Occ_xQxX8TVbWIEunSp76eo5H2OMktIU6Qo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
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 ! |
let foo = 12; | |
const bar = foo; | |
console.log(bar); // 12 | |
foo = 13; | |
console.log(bar); // 12, our const "bar" hasn't changed ! |
const foo = {}; | |
foo.bar = 42; | |
console.log(foo); // { bar: 42 } |
const foo = 12; | |
foo = 13; // TypeError: Assignment to constant variable. |