Skip to content

Instantly share code, notes, and snippets.

@elliotlarson
Created July 22, 2018 04:06
Show Gist options
  • Save elliotlarson/1d20d6f0b08b61cfb12543d7d369302e to your computer and use it in GitHub Desktop.
Save elliotlarson/1d20d6f0b08b61cfb12543d7d369302e to your computer and use it in GitHub Desktop.
// creating a copy with `slice`
const newCharacters = characters.slice();
// you could also just copy with the spread
// const newCharacters = […characters];
newCharacters.push(maude);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment