Skip to content

Instantly share code, notes, and snippets.

@SangHakLee
Last active June 8, 2016 16:12
Show Gist options
  • Save SangHakLee/2b923eceb209213d76804c226acdd3ae to your computer and use it in GitHub Desktop.
Save SangHakLee/2b923eceb209213d76804c226acdd3ae to your computer and use it in GitHub Desktop.
JavaScript variable copy
// color1의 값을 color2에 저장한다.
var color1 ="red";
var color2 = color1;
console.log(color1); // "red"
console.log(color2); // "red"
color1 = "blue"
console.log(color1); // "blue"
console.log(color2); // "red"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment