Skip to content

Instantly share code, notes, and snippets.

@inadarei
Last active February 17, 2018 01:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inadarei/be320f706293ed637328ab29bf41d699 to your computer and use it in GitHub Desktop.
Save inadarei/be320f706293ed637328ab29bf41d699 to your computer and use it in GitHub Desktop.
const a = [1,2,3,4,5];
const aCloned = [...a];
aCloned.push(7);
console.log(a);
console.log(aCloned);
const o = { name: "john", lastname: "nelson", skills: "python" };
const oCloned = { ...o };
oCloned.rancher = true;
console.log(o);
console.log(oCloned);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment