Last active
September 30, 2021 14:43
-
-
Save jmaicaaan/36f5e68c25759f49c32a633ad78853d5 to your computer and use it in GitHub Desktop.
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 person01 = { | |
name: 'JM' | |
}; | |
const person02 = person01; | |
/** | |
* Mutating `person02` will cause effect also on `person01` because | |
* `person01` was assigned by reference not by value | |
*/ | |
person02.name = 'JM Santos'; | |
console.log('person01', person01); // JM Santos | |
console.log('person02', person02); // JM Santos |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment