Created
June 29, 2022 13:30
-
-
Save PaulRosset/e8d10c9f4e30a81c7ad8943f4a98f9c3 to your computer and use it in GitHub Desktop.
Javascript reference for non primitive value
This file contains 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 contactInfos = { address: "20B Rue Lafayette" }; | |
function setAddress(infos) { | |
infos.address = "90B Rue laffite"; | |
} | |
console.warn(contactInfos); // { address: "20B Rue Lafayette" } | |
setAddress(contactInfos); | |
console.warn(contactInfos); // { address: "90B Rue laffite" } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment