Skip to content

Instantly share code, notes, and snippets.

@elliotlarson
Last active July 22, 2018 05:38
Show Gist options
  • Save elliotlarson/2d3eec476a2afb02de0708415cdf99c2 to your computer and use it in GitHub Desktop.
Save elliotlarson/2d3eec476a2afb02de0708415cdf99c2 to your computer and use it in GitHub Desktop.
// Adding Maude after Jeffrey at index 2
const newCharacters = [...characters];
newCharacters.splice(2, 0, maude);
// => ["Walter", "Jeffrey", "Maude", "Donald"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment