Skip to content

Instantly share code, notes, and snippets.

@cyberpirate92
Created May 14, 2019 13: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 cyberpirate92/ddd2abf95c6677cc63273aa0c7fc1b45 to your computer and use it in GitHub Desktop.
Save cyberpirate92/ddd2abf95c6677cc63273aa0c7fc1b45 to your computer and use it in GitHub Desktop.
// original data
x = [1, 2, 3, 4]
// making a change
x.push(5);
// reassign array to change reference
x = [...x];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment