Skip to content

Instantly share code, notes, and snippets.

@inadarei
Last active February 17, 2018 01:36
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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